Skip to content

Commit a77c89c

Browse files
committed
fix PreferenceActivity null pointer exception
1 parent a727062 commit a77c89c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

library/src/main/java/me/imid/swipebacklayout/lib/app/SwipeBackActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ protected void onPostCreate(Bundle savedInstanceState) {
2525
@Override
2626
public View findViewById(int id) {
2727
View v = super.findViewById(id);
28-
if (v != null)
29-
return v;
30-
return mHelper.findViewById(id);
28+
if (v == null && mHelper != null)
29+
return mHelper.findViewById(id);
30+
return v;
3131
}
3232

3333
@Override

library/src/main/java/me/imid/swipebacklayout/lib/app/SwipeBackPreferenceActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ protected void onPostCreate(Bundle savedInstanceState) {
2525
@Override
2626
public View findViewById(int id) {
2727
View v = super.findViewById(id);
28-
if (v != null)
29-
return v;
30-
return mHelper.findViewById(id);
28+
if (v == null && mHelper != null)
29+
return mHelper.findViewById(id);
30+
return v;
3131
}
3232

3333
@Override

0 commit comments

Comments
 (0)