From 8f230e94dcf064e8c8972050712af1356fc2dd64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Tue, 22 Jan 2019 16:13:06 +0100 Subject: [android] return empty string instead of null in offline examples --- .../main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main') diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.java index d4ec95ce5c..7a6e6ac063 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/OfflineUtils.java @@ -16,9 +16,10 @@ public class OfflineUtils { try { String json = new String(metadata, JSON_CHARSET); JsonObject jsonObject = new Gson().fromJson(json, JsonObject.class); - return jsonObject.get(JSON_FIELD_REGION_NAME).getAsString(); + String name = jsonObject.get(JSON_FIELD_REGION_NAME).getAsString(); + return name != null ? name : ""; } catch (Exception exception) { - return null; + return ""; } } -- cgit v1.2.1