Skip to content

Commit

Permalink
Merge pull request #5475 from seadowg/fix-crash
Browse files Browse the repository at this point in the history
Prevent crash when trying to log with nullable value
  • Loading branch information
grzesiek2010 authored Mar 10, 2023
2 parents bdbee2d + 3d87562 commit 9440f49
Showing 1 changed file with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,12 @@ enum AnimationType {
*/
@Override
public void onCreate(Bundle savedInstanceState) {
Timber.w("onCreate %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onCreate %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onCreate null");
}

// Workaround for https://issuetracker.google.com/issues/37124582. Some widgets trigger
// this issue by including WebViews
if (Build.VERSION.SDK_INT >= 24) {
Expand Down Expand Up @@ -796,7 +801,11 @@ private FormController getFormController() {

@Override
protected void onSaveInstanceState(Bundle outState) {
Timber.w("onSaveInstanceState %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onSaveInstanceState %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onSaveInstanceState null");
}
super.onSaveInstanceState(outState);

outState.putString(KEY_SESSION_ID, sessionId);
Expand Down Expand Up @@ -1898,7 +1907,11 @@ private void updateNavigationButtonVisibility() {

@Override
protected void onStart() {
Timber.w("onStart %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onStart %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onStart null");
}
super.onStart();
FormController formController = getFormController();

Expand All @@ -1917,15 +1930,23 @@ && new PlayServicesChecker().isGooglePlayServicesAvailable(this)) {

@Override
protected void onPause() {
Timber.w("onPause %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onPause %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onPause null");
}
backgroundLocationViewModel.activityHidden();

super.onPause();
}

@Override
protected void onResume() {
Timber.w("onResume %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onResume %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onResume null");
}
super.onResume();

activityDisplayed();
Expand Down Expand Up @@ -2032,7 +2053,11 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {

@Override
protected void onDestroy() {
Timber.w("onDestroy %s", Md5.getMd5Hash(getIntent().getData().toString()));
if (getIntent().getData() != null) {
Timber.w("onDestroy %s", Md5.getMd5Hash(getIntent().getData().toString()));
} else {
Timber.w("onDestroy null");
}
if (formLoaderTask != null) {
formLoaderTask.setFormLoaderListener(null);
// We have to call cancel to terminate the thread, otherwise it
Expand Down

0 comments on commit 9440f49

Please sign in to comment.