[android] return empty string instead of null in offline examples

This commit is contained in:
Łukasz Paczos
2019-01-22 16:13:06 +01:00
committed by Łukasz Paczos
parent f2aaac3285
commit 8f230e94dc

View File

@@ -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 "";
}
}