ソースを参照

FIxed null pointer exception when a file details view receives a message from the download service

David A. Velasco 12 年 前
コミット
393bcd6869

+ 1 - 1
AndroidManifest.xml

@@ -18,7 +18,7 @@
  -->
 <manifest package="eu.alefzero.owncloud"
     android:versionCode="1"
-    android:versionName="0.1.178B" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:versionName="0.1.179B" xmlns:android="http://schemas.android.com/apk/res/android">
 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />

+ 1 - 1
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java

@@ -556,7 +556,7 @@ public class FileDetailFragment extends SherlockFragment implements
         public void onReceive(Context context, Intent intent) {
             String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);
 
-            if (accountName.equals(mAccount.name) && mFile != null) {
+            if (!isEmpty() && accountName.equals(mAccount.name)) {
                 boolean downloadWasFine = intent.getBooleanExtra(FileDownloader.EXTRA_DOWNLOAD_RESULT, false);
                 String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);
                 if (mFile.getRemotePath().equals(downloadedRemotePath)) {