Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

android: fix crash if notification is null

Saúl Ibarra Corretgéf8a049759db9
diff --git a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java
index 01abff5140..dd3e8c25b6 100644
--- a/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java
+++ b/android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetOngoingConferenceService.java
@@ -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