Fix crashes when no Bluetooth or no Camera is available

Briar crashed when run in a device without bluetooth or without camera
such as an emulator.

Closes #514
This commit is contained in:
Torsten Grote
2016-08-04 16:44:28 -03:00
parent 054a0d467c
commit b04bde4f41
5 changed files with 15 additions and 8 deletions

View File

@@ -225,6 +225,7 @@ public class ShowQrCodeFragment extends BaseEventFragment
protected void onPostExecute(Camera camera) {
if (camera == null) {
// TODO better solution?
LOG.info("No Camera found, finishing...");
getActivity().finish();
} else {
cameraView.start(camera, decoder, 0);