AppDetails: Also check null View in header

Mirror the check already being done in the other fragment. As reported
via ACRA:

	ANDROID_VERSION=4.4.4
	APP_VERSION_NAME=0.100-alpha6
	STACK_TRACE=java.lang.NullPointerException
		at org.fdroid.fdroid.AppDetails$AppDetailsHeaderFragment.updateViews(AppDetails.java:1524)
		at org.fdroid.fdroid.AppDetails$AppDetailsHeaderFragment.updateViews(AppDetails.java:1519)
		at org.fdroid.fdroid.AppDetails.refreshHeader(AppDetails.java:624)
		at org.fdroid.fdroid.AppDetails.onAppChanged(AppDetails.java:549)
		at org.fdroid.fdroid.AppDetails.access$000(AppDetails.java:100)
		at org.fdroid.fdroid.AppDetails$AppObserver.onChange(AppDetails.java:141)
		at android.database.ContentObserver$NotificationRunnable.run(ContentObserver.java:180)
		at android.os.Handler.handleCallback(Handler.java:733)
		at android.os.Handler.dispatchMessage(Handler.java:95)
		at android.os.Looper.loop(Looper.java:136)
		at android.app.ActivityThread.main(ActivityThread.java:5146)
		at java.lang.reflect.Method.invokeNative(Native Method)
		at java.lang.reflect.Method.invoke(Method.java:515)
		at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
		at dalvik.system.NativeStart.main(Native Method)
This commit is contained in:
Daniel Martí 2016-05-07 22:38:33 +01:00
parent 1a94c46e87
commit d847f2caef

View File

@ -1527,6 +1527,10 @@ public class AppDetails extends AppCompatActivity {
} }
public void updateViews(View view) { public void updateViews(View view) {
if (view == null) {
Log.e(TAG, "AppDetailsHeaderFragment.updateViews(): view == null. Oops.");
return;
}
App app = appDetails.getApp(); App app = appDetails.getApp();
TextView statusView = (TextView) view.findViewById(R.id.status); TextView statusView = (TextView) view.findViewById(R.id.status);
btMain.setVisibility(View.VISIBLE); btMain.setVisibility(View.VISIBLE);