fixed a bug in code viewer where we might endup in infinite loop if we failed to display the data from the url.

This commit is contained in:
Kosh 2017-02-23 21:02:25 +08:00
parent 0d8e2ef22f
commit c40fa9d1ca
2 changed files with 2 additions and 4 deletions

View File

@ -95,7 +95,7 @@ public class SchemeParser {
if (gist != null) {
return GistView.createIntent(context, gist);
}
} else if (HOST_DEFAULT.equals(data.getHost())) {
} else {
Intent userIntent = getUser(context, data);
Intent pullRequestIntent = getPullRequestIntent(context, data);
Intent issueIntent = getIssueIntent(context, data);

View File

@ -67,9 +67,7 @@ class ViewerPresenter extends BasePresenter<ViewerMvp.View> implements ViewerMvp
if (downloadedStream == null) {
manageSubscription(FileModel.get(url)
.subscribe(fileModel -> {
if (fileModel == null) {
onWorkOnline();
} else {
if (fileModel != null) {
isImage = MarkDownProvider.isImage(fileModel.getFullUrl());
if (isImage) {
sendToView(view -> view.onSetImageUrl(fileModel.getFullUrl()));