diff --git a/framework/android/src/main/java/com/tencent/mtt/hippy/devsupport/DevServerImpl.java b/framework/android/src/main/java/com/tencent/mtt/hippy/devsupport/DevServerImpl.java index dd04a9f89e7..5d3a52028e5 100644 --- a/framework/android/src/main/java/com/tencent/mtt/hippy/devsupport/DevServerImpl.java +++ b/framework/android/src/main/java/com/tencent/mtt/hippy/devsupport/DevServerImpl.java @@ -31,6 +31,7 @@ import com.tencent.mtt.hippy.HippyGlobalConfigs; import com.tencent.mtt.hippy.utils.LogUtils; import com.tencent.mtt.hippy.utils.UIThreadUtils; +import java.util.EmptyStackException; import java.util.HashMap; import java.util.Stack; @@ -214,7 +215,7 @@ public void run() { if (mExceptionDialog != null && mExceptionDialog.isShowing()) { return; } - DevFloatButton button = mDevButtonStack.peek(); + DevFloatButton button = (mDevButtonStack.size() > 0) ? mDevButtonStack.peek() : null; if (button != null) { mExceptionDialog = new DevExceptionDialog(button.getContext()); mExceptionDialog.handleException(throwable);