Skip to content

Commit

Permalink
Fixed NullPointerExceptions (in particular related to headset plug-in)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisfeld committed Sep 11, 2017
1 parent 4b8a621 commit df93704
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,13 @@ private void registerHeadsetReceiver() {
mHeadsetPlugReceiver.register(this, new HeadsetPlugReceiver.HeadsetPlugHandler() {
@Override
public void handleHeadsetPlug(final boolean plugged) {
configureFlashlightButton();
try {
configureFlashlightButton();
}
catch (Exception e) {
TrackingUtil.sendException("hea1", e);
return;
}
if (plugged && mCurrentFlashlightMode != FlashMode.EXT) {
DialogUtil.displayConfirmationMessage(CameraActivity.this, new ConfirmDialogListener() {
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ private void unlockFocus() {
mState = CameraState.STATE_PREVIEW;
mCaptureSession.setRepeatingRequest(mPreviewRequest, mCaptureCallback, mBackgroundHandler);
}
catch (CameraAccessException | IllegalStateException e) {
catch (CameraAccessException | IllegalStateException | NullPointerException e) {
mCameraCallback.onCameraError("Failed to unlock focus", "unl1", e);
}
}
Expand Down

0 comments on commit df93704

Please sign in to comment.