fixed messages issue

This commit is contained in:
gdlbo
2023-05-23 23:03:10 +03:00
parent d1445c2801
commit 56a6a6de03
2 changed files with 5 additions and 4 deletions
@@ -9,7 +9,7 @@ import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
public class BannerHook {
public static JSONObject convBar(JSONObject orig) throws JSONException {
public static JSONObject convBar(JSONObject orig) {
return ImBanner.convBar(orig);
}
@@ -8,10 +8,11 @@ import org.json.JSONObject;
public class ImBanner {
private static final String TAG = "ImBanner";
public static JSONObject convBar(JSONObject orig) throws JSONException {
var user_id = orig.getJSONObject("peer").getInt("id");
public static JSONObject convBar(JSONObject orig) {
var user = orig.optJSONObject("peer");
var user_id = user != null ? user.optInt("id") : 0;
if (!UsersList.hasBanner(user_id) || user_id == 0) {
if (user_id == 0 || !UsersList.hasBanner(user_id)) {
return null;
}