Skip to content

Commit

Permalink
Fix loading local images (#4769)
Browse files Browse the repository at this point in the history
When loading local image resource (images in Drawable folder), RNN mistakingly tried to load the image as a js asset even if it successfully loaded the local image.
  • Loading branch information
guyca authored Feb 20, 2019
1 parent be17322 commit c82bc57
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,15 @@ public void loadIcons(final Context context, List<String> uris, ImagesLoadingLis
@NonNull
private Drawable getDrawable(Context context, String source) throws IOException {
Drawable drawable;

if (isLocalFile(Uri.parse(source))) {
drawable = loadFile(source);
} else {
drawable = loadResource(source);
if (drawable == null || NavigationApplication.instance.isDebug()) {
if (drawable == null && NavigationApplication.instance.isDebug()) {
drawable = readJsDevImage(context, source);
}
}

if (drawable == null) throw new RuntimeException("Could not load image " + source);
return drawable;
}

Expand Down

0 comments on commit c82bc57

Please sign in to comment.