Skip to content

Commit

Permalink
throw exception when markerId is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorch committed Jul 24, 2024
1 parent eed2ff5 commit 5dd7d4d
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ protected void onCreate(Bundle bundle) {
super.onCreate(bundle);

Marker.Id markerId = new Marker.Id(getIntent().getLongExtra(EXTRA_MARKER_ID, 0));
if (markerId.id() == 0) {
throw new IllegalStateException("No valid markerId provided");
}
Intent intent = IntentUtils.newIntent(this, MarkerDetailActivity.class)
.putExtra(MarkerDetailActivity.EXTRA_MARKER_ID, markerId);
startActivity(intent);
Expand Down

0 comments on commit 5dd7d4d

Please sign in to comment.