Merge pull request #2005 from nextcloud/bugfix/1978/fixNPEpeerConnectionWrapper

Bugfix/1978/fix npe in peerConnectionWrapper
This commit is contained in:
Andy Scherzinger 2022-05-09 15:31:59 +02:00 committed by GitHub
commit 973d13f902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,6 +49,7 @@ import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Toast;
import com.bluelinelabs.logansquare.LoganSquare; import com.bluelinelabs.logansquare.LoganSquare;
import com.nextcloud.talk.R; import com.nextcloud.talk.R;
@ -1885,6 +1886,14 @@ public class CallActivity extends CallBaseActivity {
if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) { if ((peerConnectionWrapper = getPeerConnectionWrapperForSessionIdAndType(sessionId, type)) != null) {
return peerConnectionWrapper; return peerConnectionWrapper;
} else { } 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) { if (hasMCU && publisher) {
peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory, peerConnectionWrapper = new PeerConnectionWrapper(peerConnectionFactory,
iceServers, iceServers,