Added guard code as sometimes the error message is null.

This commit is contained in:
Julian Harty 2017-08-17 16:04:59 -04:00
parent e28a04542f
commit 5a7bcfbc98

View File

@ -34,7 +34,8 @@ public class LibraryPresenter extends BasePresenter<LibraryViewCallback> {
.subscribe(library -> { .subscribe(library -> {
getMvpView().showBooks(library.getBooks()); getMvpView().showBooks(library.getBooks());
}, error -> { }, error -> {
Log.w("kiwixLibrary", error.getLocalizedMessage()); String msg = error.getLocalizedMessage();
Log.w("kiwixLibrary", "Error:" + (msg != null ? msg : "(null)"));
getMvpView().displayNoNetworkConnection(); getMvpView().displayNoNetworkConnection();
}); });
} }