From 828ea5943de2584b36e2799ed5f4e36aebbc5a9f Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 7 Mar 2017 10:13:34 +0100 Subject: [PATCH] Fix Notification registration crash when LpConfig not exist yet --- src/org/linphone/LinphonePreferences.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphonePreferences.java b/src/org/linphone/LinphonePreferences.java index a22a065e2..0f2f94b06 100644 --- a/src/org/linphone/LinphonePreferences.java +++ b/src/org/linphone/LinphonePreferences.java @@ -1126,8 +1126,9 @@ public class LinphonePreferences { } public void setPushNotificationRegistrationID(String regId) { - getConfig().setString("app", "push_notification_regid", (regId != null) ? regId: ""); - setPushNotificationEnabled(isPushNotificationEnabled()); + if (getConfig() == null) return; + getConfig().setString("app", "push_notification_regid", (regId != null) ? regId: ""); + setPushNotificationEnabled(isPushNotificationEnabled()); } public String getPushNotificationRegistrationID() {