Skip to content

Commit

Permalink
fix(android): add try catch to peek exception
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 committed Nov 13, 2024
1 parent 8dee058 commit aecc826
Showing 1 changed file with 11 additions and 6 deletions.
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,12 +215,16 @@ public void run() {
if (mExceptionDialog != null && mExceptionDialog.isShowing()) {
return;
}
DevFloatButton button = mDevButtonStack.peek();
if (button != null) {
mExceptionDialog = new DevExceptionDialog(button.getContext());
mExceptionDialog.handleException(throwable);
mExceptionDialog.setOnReloadListener(DevServerImpl.this);
mExceptionDialog.show();
try {
DevFloatButton button = mDevButtonStack.peek();
if (button != null) {
mExceptionDialog = new DevExceptionDialog(button.getContext());
mExceptionDialog.handleException(throwable);
mExceptionDialog.setOnReloadListener(DevServerImpl.this);
mExceptionDialog.show();
}
} catch (EmptyStackException e) {
e.printStackTrace();
}
}
});
Expand Down

0 comments on commit aecc826

Please sign in to comment.