[FIX] Hide reply notification action when there are missing data (#1771)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-02-28 13:35:47 -03:00 committed by GitHub
parent fac0958b8b
commit 5eb824aeb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -252,7 +252,9 @@ public class CustomPushNotification extends PushNotification {
} }
private void notificationReply(Notification.Builder notification, int notificationId, Bundle bundle) { private void notificationReply(Notification.Builder notification, int notificationId, Bundle bundle) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { String notId = bundle.getString("notId", "1");
String ejson = bundle.getString("ejson", "{}");
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || notId.equals("1") || ejson.equals("{}")) {
return; return;
} }
String label = "Reply"; String label = "Reply";

View File

@ -30,7 +30,7 @@ public class Ejson {
public String serverURL() { public String serverURL() {
String url = this.host; String url = this.host;
if (url.endsWith("/")) { if (url != null && url.endsWith("/")) {
url = url.substring(0, url.length() - 1); url = url.substring(0, url.length() - 1);
} }
return url; return url;