Skip to content

Commit 01f1437

Browse files
author
Pierre Segalen
committed
Fix issue a7ul#100 (Crash in DefaultErrorScreen.onCreate on rooted phones)
1 parent 7ed6f43 commit 01f1437

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

android/src/main/java/com/masteratul/exceptionhandler/DefaultErrorScreen.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ public class DefaultErrorScreen extends Activity {
2222
@Override
2323
protected void onCreate(Bundle savedInstanceState) {
2424
super.onCreate(savedInstanceState);
25-
String stackTraceString = getIntent().getExtras().getString("stack_trace_string");
25+
String stackTraceString = "StackTrace unavailable";
26+
try {
27+
stackTraceString = getIntent().getExtras().getString("stack_trace_string");
28+
}
29+
catch (Exception e) {
30+
Log.e(TAG, String.format("Was not able to get StackTrace: %s", e.getMessage()));
31+
}
2632
setContentView(R.layout.default_error_screen);
2733
quitButton = (Button) findViewById(R.id.eh_quit_button);
2834
relaunchButton = (Button) findViewById(R.id.eh_restart_button);

0 commit comments

Comments
 (0)