Skip to content

Commit

Permalink
fix(android): avoid peek EmptyStackException
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 committed Nov 26, 2024
1 parent 8dee058 commit 37c0fc5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 37c0fc5

Please sign in to comment.