mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
Fix NPE #603
This commit is contained in:
parent
b2886b81c9
commit
f1d07c83f6
@ -42,7 +42,7 @@ public class NotificationUtils {
|
|||||||
case CONVERSATIONS:
|
case CONVERSATIONS:
|
||||||
case FACEBOOK:
|
case FACEBOOK:
|
||||||
case FACEBOOK_MESSENGER:
|
case FACEBOOK_MESSENGER:
|
||||||
return notificationSpec.body;
|
return StringUtils.ensureNotNull(notificationSpec.body);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import android.support.annotation.NonNull;
|
|||||||
|
|
||||||
public class StringUtils {
|
public class StringUtils {
|
||||||
|
|
||||||
|
@NonNull
|
||||||
public static String truncate(String s, int maxLength){
|
public static String truncate(String s, int maxLength){
|
||||||
if (s == null) {
|
if (s == null) {
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
Reference in New Issue
Block a user