Skip to content

Commit fa0fecb

Browse files
committed
Handle exception on adding activity header
1 parent a7d77c6 commit fa0fecb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support/fragment/DynamicViewPager2Fragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ && requireArguments().containsKey(ADS_ARGS_VIEW_PAGER_PAGE)) {
9191
public void onAddActivityHeader(@Nullable View view) {
9292
super.onAddActivityHeader(view);
9393

94-
if (view == null) {
94+
if (getContext() == null || view == null) {
9595
return;
9696
}
9797

dynamic-support/src/main/java/com/pranavpandey/android/dynamic/support/fragment/DynamicViewPagerFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ && requireArguments().containsKey(ADS_ARGS_VIEW_PAGER_PAGE)) {
9191
public void onAddActivityHeader(@Nullable View view) {
9292
super.onAddActivityHeader(view);
9393

94-
if (view == null) {
94+
if (getContext() == null || view == null) {
9595
return;
9696
}
9797

0 commit comments

Comments
 (0)