Skip to content

Commit b55ad9c

Browse files
committed
Added check for if no tutorial items are passed
1 parent a64464a commit b55ad9c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

materialhelptutorial/src/main/java/za/co/riggaroo/materialhelptutorial/tutorial/MaterialTutorialActivity.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
public class MaterialTutorialActivity extends AppCompatActivity implements MaterialTutorialContract.View {
2525

26-
private static final String TAG = "MaterialTutActivity";
2726
public static final String MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS = "tutorial_items";
27+
private static final String TAG = "MaterialTutActivity";
2828
private ViewPager mHelpTutorialViewPager;
2929
private View mRootView;
3030
private TextView mTextViewSkip;
@@ -63,7 +63,6 @@ protected void onCreate(Bundle savedInstanceState) {
6363
mDoneButton.setOnClickListener(finishTutorialClickListener);
6464

6565

66-
6766
mNextButton.setOnClickListener(new View.OnClickListener() {
6867
@Override
6968
public void onClick(View v) {
@@ -73,7 +72,11 @@ public void onClick(View v) {
7372
}
7473
});
7574
List<TutorialItem> tutorialItems = getIntent().getParcelableArrayListExtra(MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS);
76-
materialTutorialPresenter.loadViewPagerFragments(tutorialItems);
75+
if (tutorialItems == null) {
76+
showEndTutorial();
77+
} else {
78+
materialTutorialPresenter.loadViewPagerFragments(tutorialItems);
79+
}
7780
}
7881

7982
private void setStatusBarColor() {

0 commit comments

Comments
 (0)