浏览代码

Merge pull request #3226 from nextcloud/NPEonTrashbin

UI can already be non-existent
Tobias Kaminsky 6 年之前
父节点
当前提交
b997966e90
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.java

+ 4 - 2
src/main/java/com/owncloud/android/ui/trashbin/TrashbinActivity.java

@@ -275,9 +275,11 @@ public class TrashbinActivity extends FileActivity implements TrashbinActivityIn
 
     @Override
     public void showError(int message) {
-        swipeListRefreshLayout.setRefreshing(false);
+        if (swipeListRefreshLayout != null) {
+            swipeListRefreshLayout.setRefreshing(false);
+        }
 
-        if (emptyContentMessage != null) {
+        if (emptyContentMessage != null && emptyContentHeadline != null && emptyContentIcon != null) {
             emptyContentHeadline.setText(R.string.common_error);
             emptyContentIcon.setImageDrawable(getResources().getDrawable(R.drawable.ic_list_empty_error));
             emptyContentMessage.setText(message);