Fix crash when toggling media

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-12 11:02:54 +01:00
parent d13efcc019
commit f8f756da87

View File

@ -341,7 +341,7 @@ public class CallActivity extends AppCompatActivity {
}
}
if (localMediaStream.videoTracks.size() > 0) {
if (localMediaStream != null && localMediaStream.videoTracks.size() > 0) {
localMediaStream.videoTracks.get(0).setEnabled(enable);
}
@ -356,7 +356,7 @@ public class CallActivity extends AppCompatActivity {
message = "audioOn";
}
if (localMediaStream.audioTracks.size() > 0) {
if (localMediaStream != null && localMediaStream.audioTracks.size() > 0) {
localMediaStream.audioTracks.get(0).setEnabled(enable);
}
}