From 4d741831ac1ccf48f1bc40f277ccb7825f9ee674 Mon Sep 17 00:00:00 2001 From: Amr Hossam Date: Mon, 11 Mar 2024 13:33:45 +0200 Subject: [PATCH] Fixed #1163 - Restoring backup crash. Signed-off-by: Amr Hossam --- .../java/org/onebusaway/android/ui/PreferencesActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/PreferencesActivity.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/PreferencesActivity.java index f8e28ff0c..7e1363c01 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/PreferencesActivity.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/PreferencesActivity.java @@ -402,7 +402,9 @@ public void onRequestPermissionsResult( protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_RESTORE_BACKUP) { - BackupUtils.restore(this, data.getData()); + if(data != null){ + BackupUtils.restore(this, data.getData()); + } } }