Check if videocapturer is null

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-01-14 22:33:47 +01:00
parent c8ff05ed04
commit 8df1cdf964

View File

@ -336,10 +336,12 @@ public class CallActivity extends AppCompatActivity {
message = "videoOn";
startVideoCapture();
} else {
try {
videoCapturer.stopCapture();
} catch (InterruptedException e) {
Log.d(TAG, "Failed to stop capturing video while sensor is near the ear");
if (videoCapturer != null) {
try {
videoCapturer.stopCapture();
} catch (InterruptedException e) {
Log.d(TAG, "Failed to stop capturing video while sensor is near the ear");
}
}
}