瀏覽代碼

bugfix for NPE #201

Andy Scherzinger 8 年之前
父節點
當前提交
e6ba8a7e53
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

+ 8 - 4
src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

@@ -243,10 +243,14 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
 
             TextView accountNameTextView = (TextView) view.findViewById(R.id.upload_account);
             Account account = AccountUtils.getOwnCloudAccountByName(mParentActivity, upload.getAccountName());
-            accountNameTextView.setText(
-                    DisplayUtils.getAccountNameDisplayText(
-                            mParentActivity, account, account.name, upload.getAccountName())
-            );
+            if (account != null) {
+                accountNameTextView.setText(
+                        DisplayUtils.getAccountNameDisplayText(
+                                mParentActivity, account, account.name, upload.getAccountName())
+                );
+            } else {
+                accountNameTextView.setText(upload.getAccountName());
+            }
 
             TextView statusTextView = (TextView) view.findViewById(R.id.upload_status);