1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-21 12:35:10 +00:00

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

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);