From 62e89d42f2be04fa0d63bafba9516c152281a914 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 7 May 2012 16:53:11 +0200 Subject: [PATCH] fix two crashes --- src/org/linphone/LinphoneActivity.java | 11 +++++++---- src/org/linphone/VideoCallActivity.java | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 0a7aa174b..90d5b1760 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -452,10 +452,13 @@ public class LinphoneActivity extends TabActivity implements ContactPicked Log.d("Phone orientation changed to ", degrees); int rotation = (360 - degrees) % 360; - LinphoneManager.getLc().setDeviceRotation(rotation); - LinphoneCall currentCall = LinphoneManager.getLc().getCurrentCall(); - if (currentCall != null && currentCall.cameraEnabled() && currentCall.getCurrentParamsCopy().getVideoEnabled()) { - LinphoneManager.getLc().updateCall(currentCall, null); + LinphoneCore lc=LinphoneManager.getLcIfManagerNotDestroyedOrNull(); + if (lc!=null){ + lc.setDeviceRotation(rotation); + LinphoneCall currentCall = lc.getCurrentCall(); + if (currentCall != null && currentCall.cameraEnabled() && currentCall.getCurrentParamsCopy().getVideoEnabled()) { + lc.updateCall(currentCall, null); + } } } } diff --git a/src/org/linphone/VideoCallActivity.java b/src/org/linphone/VideoCallActivity.java index 979ce5dcc..57a524308 100755 --- a/src/org/linphone/VideoCallActivity.java +++ b/src/org/linphone/VideoCallActivity.java @@ -177,7 +177,8 @@ public class VideoCallActivity extends Activity implements }); if (!AndroidCameraConfiguration.hasSeveralCameras()) { - findViewById(R.id.switch_camera).setVisibility(View.GONE); + View v=findViewById(R.id.switch_camera); + if (v!=null) v.setVisibility(View.GONE); } if (Version.isXLargeScreen(this)) {