Skip to content

Commit

Permalink
guard against NPEs
Browse files Browse the repository at this point in the history
  • Loading branch information
travisfw committed Oct 12, 2016
1 parent 247c53b commit 6e25bd7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private static Camera getCameraInstance() {
protected boolean mIsFlashOn;

/** the intent {@link android.content.Intent#getAction action} that led to this activity. */
protected String action;
protected String action = null;

/** <a href="http://www.openintents.org/action/org-openintents-action-pick-color/">
* see openintents.org</a> */
Expand All @@ -220,7 +220,9 @@ protected void onCreate(Bundle savedInstanceState) {
initViews();
initTranslationDeltas();

action = getIntent().getAction();
Intent intent = getIntent();
if (intent != null)
action = intent.getAction();
}

@Override
Expand Down

0 comments on commit 6e25bd7

Please sign in to comment.