Avoid null pointer exception when the details fragment is empty
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / ui / fragment / FileDetailFragment.java
index 8abf569..8dcdb9c 100644 (file)
@@ -463,7 +463,9 @@ public class FileDetailFragment extends SherlockFragment implements
     private class DownloadFinishReceiver extends BroadcastReceiver {\r
         @Override\r
         public void onReceive(Context context, Intent intent) {\r
-            getView().findViewById(R.id.fdDownloadBtn).setEnabled(true);\r
+            if (getView()!=null && getView().findViewById(R.id.fdDownloadBtn) != null) \r
+                getView().findViewById(R.id.fdDownloadBtn).setEnabled(true);\r
+            \r
             if (intent.getAction().equals(FileDownloader.BAD_DOWNLOAD_MESSAGE)) {\r
                 Toast.makeText(context, R.string.downloader_download_failed , Toast.LENGTH_SHORT).show();\r
                 \r