Commit 1f2afed3 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update SidebarMainFragment.java

parent 98528125
...@@ -478,7 +478,7 @@ public class MethodCallHelper { ...@@ -478,7 +478,7 @@ public class MethodCallHelper {
.put(new JSONObject().put("rooms", true).put("users", true)) .put(new JSONObject().put("rooms", true).put("users", true))
).onSuccessTask(CONVERT_TO_JSON_OBJECT) ).onSuccessTask(CONVERT_TO_JSON_OBJECT)
.onSuccessTask(task -> { .onSuccessTask(task -> {
String jsonString = ""; String jsonString = null;
final JSONObject result = task.getResult(); final JSONObject result = task.getResult();
if (result.has("rooms")) { if (result.has("rooms")) {
...@@ -493,14 +493,14 @@ public class MethodCallHelper { ...@@ -493,14 +493,14 @@ public class MethodCallHelper {
RealmSpotlight.Companion.customizeUserJsonObject(userJsonArray.getJSONObject(i)); RealmSpotlight.Companion.customizeUserJsonObject(userJsonArray.getJSONObject(i));
} }
if (jsonString.equals("")) { if (jsonString == null) {
jsonString = userJsonArray.toString(); jsonString = userJsonArray.toString();
} else { } else {
jsonString = jsonString.replace("]", "") + "," + userJsonArray.toString().replace("[", ""); jsonString = jsonString.replace("]", "") + "," + userJsonArray.toString().replace("[", "");
} }
} }
if (!jsonString.equals("")) { if (jsonString != null) {
String jsonStringResults = jsonString; String jsonStringResults = jsonString;
realmHelper.executeTransaction(realm -> { realmHelper.executeTransaction(realm -> {
realm.delete(RealmSpotlight.class); realm.delete(RealmSpotlight.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment