Skip to content

Commit

Permalink
Fix loading of local resources
Browse files Browse the repository at this point in the history
Fixes #409
  • Loading branch information
mickaelistria committed Jun 7, 2022
1 parent 1f169c3 commit 71390bf
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,9 @@ public String getPluginId() {
@Nullable
@Override
public InputStream getInputStream() throws IOException {
if (Strings.isNullOrEmpty(path)) {
return null;
}
if (!Strings.isNullOrEmpty(path)) {
final URL url = new URL(PLATFORM_PLUGIN + pluginId + "/" + path);
return url.openStream();
}
return new FileInputStream(new File(path));
return pluginId != null ?
new URL(PLATFORM_PLUGIN + pluginId + "/" + path).openStream() : //
new FileInputStream(new File(path));
}

@Nullable
Expand Down

0 comments on commit 71390bf

Please sign in to comment.