From ce3b123bd1b0e56c36f345f072bbecf86e5a0bbe Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 6 Apr 2011 15:37:59 +0200 Subject: [PATCH] Fix? NPE when updating a (no more) exisiting call. --- src/org/linphone/CallManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/org/linphone/CallManager.java b/src/org/linphone/CallManager.java index b7138bb3e..a1be11c64 100644 --- a/src/org/linphone/CallManager.java +++ b/src/org/linphone/CallManager.java @@ -25,6 +25,8 @@ import org.linphone.core.LinphoneCore; import org.linphone.core.LinphoneCoreException; import org.linphone.core.video.AndroidCameraRecordManager; +import android.util.Log; + /** * Handle call updating, reinvites. * @@ -79,6 +81,10 @@ class CallManager { boolean reinviteWithVideo() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); + if (lCall == null) { + Log.e(LinphoneManager.TAG, "Trying to reinviteWithVideo while not in call: doing nothing"); + return false; + } LinphoneCallParams params = lCall.getCurrentParamsCopy(); if (params.getVideoEnabled()) return false; @@ -105,6 +111,10 @@ class CallManager { void reinvite() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); + if (lCall == null) { + Log.e(LinphoneManager.TAG, "Trying to reinvite while not in call: doing nothing"); + return; + } LinphoneCallParams params = lCall.getCurrentParamsCopy(); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, params); @@ -117,6 +127,10 @@ class CallManager { void updateCall() { LinphoneCore lc = LinphoneManager.getLc(); LinphoneCall lCall = lc.getCurrentCall(); + if (lCall == null) { + Log.e(LinphoneManager.TAG, "Trying to updateCall while not in call: doing nothing"); + return; + } LinphoneCallParams params = lCall.getCurrentParamsCopy(); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, null);