Merge pull request #1724 from travkin79/patch/fix-NPE

Avoid NPE when a remote input stream cannot be read (while reading a remote style file)
This commit is contained in:
PlantUML 2024-04-06 13:22:10 +02:00 committed by GitHub
commit 06d06e729b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -86,7 +86,9 @@ public class CommandStyleImport extends SingleLineCommand2<TitledDiagram> {
if (path.startsWith("http://") || path.startsWith("https://")) {
SURL url = SURL.create(path);
try (InputStream remoteInputStream = url.openStream()) {
lines = BlocLines.load(remoteInputStream, location);
if (remoteInputStream != null) {
lines = BlocLines.load(remoteInputStream, location);
}
}
} else {
final SFile styleFile = FileSystem.getInstance().getFile(path);