Skip to content

Commit

Permalink
FIX null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Hener committed Jan 18, 2017
1 parent a93feab commit 911d664
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package gun0912.tedbottompicker;

import com.commonsware.cwac.provider.StreamProvider;
import com.tbruyelle.rxpermissions.RxPermissions;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
Expand All @@ -11,9 +14,6 @@
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;

import com.commonsware.cwac.provider.StreamProvider;
import com.tbruyelle.rxpermissions.RxPermissions;

import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -74,7 +74,9 @@ public void call(Throwable _throwable) {

@Override
public void onSaveInstanceState(Bundle outState) {
outState.putString(CAMERA_URI, cameraImageUri.getPath());
if (cameraImageUri != null) {
outState.putString(CAMERA_URI, cameraImageUri.getPath());
}
super.onSaveInstanceState(outState);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ private void errorMessage() {
private void errorMessage(String message) {
String errorMessage = message == null ? "Something wrong." : message;

if (builder == null) {
return;
}
if (builder.onErrorListener == null) {
Toast.makeText(getActivity(), errorMessage, Toast.LENGTH_SHORT).show();
} else {
Expand Down

0 comments on commit 911d664

Please sign in to comment.