From 6551e394215ceb88f96c61b60bc9a9d194529636 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 27 Oct 2014 11:05:26 +0100 Subject: [PATCH] Prevent crash when trying to access Lc from Manager --- src/org/linphone/LinphoneManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index ab2f49f38..8c2dd9ae7 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1230,10 +1230,10 @@ public class LinphoneManager implements LinphoneCoreListener { public static synchronized LinphoneCore getLcIfManagerNotDestroyedOrNull() { - if (sExited) { + if (sExited || instance == null) { // Can occur if the UI thread play a posted event but in the meantime the LinphoneManager was destroyed // Ex: stop call and quickly terminate application. - Log.w("Trying to get linphone core while LinphoneManager already destroyed"); + Log.w("Trying to get linphone core while LinphoneManager already destroyed or not created"); return null; } return getLc();