Skip to content

Commit a81bc87

Browse files
weixifanhiranya911
authored andcommitted
Fix a NullPointerException in the FirebaseProjectManagementIT (firebase#222)
* Fix a NullPointerException in the FirebaseProjectManagementIT.
1 parent aacafec commit a81bc87

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/test/java/com/google/firebase/projectmanagement/FirebaseProjectManagementIT.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public static void setUpClass() throws Exception {
4949
// Ensure that we have created a Test iOS App.
5050
List<IosApp> iosApps = projectManagement.listIosApps();
5151
for (IosApp iosApp : iosApps) {
52-
if (iosApp.getMetadata().getDisplayName().startsWith(TEST_APP_DISPLAY_NAME_PREFIX)) {
52+
if (Strings.nullToEmpty(iosApp.getMetadata().getDisplayName())
53+
.startsWith(TEST_APP_DISPLAY_NAME_PREFIX)) {
5354
testIosAppId = iosApp.getAppId();
5455
}
5556
}
@@ -61,7 +62,8 @@ public static void setUpClass() throws Exception {
6162
// Ensure that we have created a Test Android App.
6263
List<AndroidApp> androidApps = projectManagement.listAndroidApps();
6364
for (AndroidApp androidApp : androidApps) {
64-
if (androidApp.getMetadata().getDisplayName().startsWith(TEST_APP_DISPLAY_NAME_PREFIX)) {
65+
if (Strings.nullToEmpty(androidApp.getMetadata().getDisplayName())
66+
.startsWith(TEST_APP_DISPLAY_NAME_PREFIX)) {
6567
testAndroidAppId = androidApp.getAppId();
6668
}
6769
}

0 commit comments

Comments
 (0)