Trying to prevent some crashes

This commit is contained in:
Sylvain Berfini 2018-10-03 11:18:01 +02:00
parent 7d533c0c26
commit fba1be573e
2 changed files with 6 additions and 4 deletions

View file

@ -323,8 +323,10 @@ public class LinphoneManager implements CoreListener, SensorEventListener, Accou
} }
public synchronized static final LinphoneManager createAndStart(Context c) { public synchronized static final LinphoneManager createAndStart(Context c) {
if (instance != null) if (instance != null) {
throw new RuntimeException("Linphone Manager is already initialized"); Log.e("Linphone Manager is already initialized ! Destroying it and creating a new one...");
destroy();
}
instance = new LinphoneManager(c); instance = new LinphoneManager(c);
instance.startLibLinphone(c); instance.startLibLinphone(c);

View file

@ -1640,10 +1640,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
if (isVideo) { if (isVideo) {
formatText(videoResolutionSent, formatText(videoResolutionSent,
getString(R.string.call_stats_video_resolution_sent), getString(R.string.call_stats_video_resolution_sent),
"\u2191 " + params.getSentVideoDefinition().getName()); "\u2191 " + params.getSentVideoDefinition() != null ? params.getSentVideoDefinition().getName() : "");
formatText(videoResolutionReceived, formatText(videoResolutionReceived,
getString(R.string.call_stats_video_resolution_received), getString(R.string.call_stats_video_resolution_received),
"\u2193 " + params.getReceivedVideoDefinition().getName()); "\u2193 " + params.getReceivedVideoDefinition() != null ? params.getReceivedVideoDefinition().getName() : "");
formatText(videoFpsSent, formatText(videoFpsSent,
getString(R.string.call_stats_video_fps_sent), getString(R.string.call_stats_video_fps_sent),
"\u2191 " + params.getSentFramerate()); "\u2191 " + params.getSentFramerate());