浏览代码

Fix a crash

inorichi 9 年之前
父节点
当前提交
e6b7a79bee
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      app/src/main/java/eu/kanade/mangafeed/ui/manga/myanimelist/MyAnimeListFragment.java

+ 6 - 4
app/src/main/java/eu/kanade/mangafeed/ui/manga/myanimelist/MyAnimeListFragment.java

@@ -45,10 +45,12 @@ public class MyAnimeListFragment extends BaseRxFragment<MyAnimeListPresenter> {
     }
 
     public void setMangaSync(MangaSync mangaSync) {
-        title.setText(mangaSync.title);
-        chapters.setText(mangaSync.last_chapter_read + "");
-        score.setText(mangaSync.score == 0 ? "-" : decimalFormat.format(mangaSync.score));
-        status.setText(getPresenter().myAnimeList.getStatus(mangaSync.status));
+        if (mangaSync != null) {
+            title.setText(mangaSync.title);
+            chapters.setText(mangaSync.last_chapter_read + "");
+            score.setText(mangaSync.score == 0 ? "-" : decimalFormat.format(mangaSync.score));
+            status.setText(getPresenter().myAnimeList.getStatus(mangaSync.status));
+        }
     }
 
     private void showSearchDialog() {