From: David A. Velasco Date: Mon, 9 Jul 2012 12:24:13 +0000 (+0200) Subject: Avoid null pointer exception when the details fragment is empty X-Git-Tag: oc-android-1.4.3~297 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/271a4ba1dfdea914b70ef3b10f6930de68d39d68?ds=inline Avoid null pointer exception when the details fragment is empty --- diff --git a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java index 8abf5696..8dcdb9cc 100644 --- a/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java +++ b/src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java @@ -463,7 +463,9 @@ public class FileDetailFragment extends SherlockFragment implements private class DownloadFinishReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - getView().findViewById(R.id.fdDownloadBtn).setEnabled(true); + if (getView()!=null && getView().findViewById(R.id.fdDownloadBtn) != null) + getView().findViewById(R.id.fdDownloadBtn).setEnabled(true); + if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) { Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show();