Skip to content

Commit

Permalink
Merge pull request #1 from carousell/fix/callback_null_pointer
Browse files Browse the repository at this point in the history
check mCaptureSession for null in capture callback
  • Loading branch information
Kanskiy authored Oct 16, 2017
2 parents 69908cb + aedd8e1 commit 23dbb88
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ public void onPrecaptureRequired() {

@Override
public void onReady() {
captureStillPicture();
if (isCameraOpened()){
captureStillPicture();
}
}

};
Expand Down Expand Up @@ -762,7 +764,9 @@ void captureStillPicture() {
public void onCaptureCompleted(@NonNull CameraCaptureSession session,
@NonNull CaptureRequest request,
@NonNull TotalCaptureResult result) {
unlockFocus();
if (isCameraOpened()){
unlockFocus();
}
}
}, null);
mCameraHandler.removeCallbacks(mReturnToContinuousAFRunnable);
Expand Down

0 comments on commit 23dbb88

Please sign in to comment.