android: fix crash if notification is null
I cannot see a path leading to it being null, but Crashlytics demonstrated it's possible (so far in a small subset of old devices). Be defensive then.
This commit is contained in:
parent
4b4225e14f
commit
f8a049759d
|
@ -82,8 +82,13 @@ public class JitsiMeetOngoingConferenceService extends Service
|
|||
final String action = intent.getAction();
|
||||
if (action.equals(Actions.START)) {
|
||||
Notification notification = OngoingNotification.buildOngoingConferenceNotification();
|
||||
startForeground(OngoingNotification.NOTIFICATION_ID, notification);
|
||||
Log.i(TAG, "Service started");
|
||||
if (notification == null) {
|
||||
stopSelf();
|
||||
Log.w(TAG, "Couldn't start service, notification is null");
|
||||
} else {
|
||||
startForeground(OngoingNotification.NOTIFICATION_ID, notification);
|
||||
Log.i(TAG, "Service started");
|
||||
}
|
||||
} else if (action.equals(Actions.HANGUP)) {
|
||||
Log.i(TAG, "Hangup requested");
|
||||
// Abort all ongoing calls
|
||||
|
|
Loading…
Reference in New Issue