diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index ca783f20a8..4ceefb3fd2 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -49,6 +49,7 @@ import android.view.ViewTreeObserver; import android.widget.FrameLayout; import android.widget.RelativeLayout; +import android.widget.Toast; import com.bluelinelabs.logansquare.LoganSquare; import com.nextcloud.talk.R; @@ -1885,6 +1886,14 @@ private PeerConnectionWrapper getOrCreatePeerConnectionWrapperForSessionIdAndTyp if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) { return peerConnectionWrapper; } else { + if (peerConnectionFactory == null) { + Log.e(TAG, "peerConnectionFactory was null in getOrCreatePeerConnectionWrapperForSessionIdAndType."); + Toast.makeText(context, context.getResources().getString(R.string.nc_common_error_sorry), + Toast.LENGTH_LONG).show(); + hangup(true); + return null; + } + if (hasMCU && publisher) { peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, iceServers,