Skip to content

Commit

Permalink
Fix butterknife unbinder NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
aarcosg committed Jun 9, 2016
1 parent 92bd201 commit 5cc23d8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ android {
applicationId "us.idinfor.smartcitizen"
minSdkVersion 15
targetSdkVersion 23
versionCode 7
versionName "1.2.3"
versionCode 8
versionName "1.2.4"
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ protected void onDestroy() {
if(mDrawerLayout != null){
mDrawerLayout.removeDrawerListener(mDrawerToggle);
}
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public Object instantiateItem(ViewGroup container, int position) {
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public void onResume() {
@Override
public void onDestroyView() {
super.onDestroyView();
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public void onResume() {
@Override
public void onDestroyView() {
super.onDestroyView();
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public void onResume() {
@Override
public void onDestroyView() {
super.onDestroyView();
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public void onPause() {
@Override
public void onDestroyView() {
super.onDestroyView();
mUnbinder.unbind();
if(mUnbinder != null){
mUnbinder.unbind();
}
}

@Override
Expand Down

0 comments on commit 5cc23d8

Please sign in to comment.