[android] return empty string instead of null in offline examples
This commit is contained in:
committed by
Łukasz Paczos
parent
f2aaac3285
commit
8f230e94dc
@@ -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 "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user