mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-28 15:56:31 +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:
commit
06d06e729b
@ -86,8 +86,10 @@ public class CommandStyleImport extends SingleLineCommand2<TitledDiagram> {
|
|||||||
if (path.startsWith("http://") || path.startsWith("https://")) {
|
if (path.startsWith("http://") || path.startsWith("https://")) {
|
||||||
SURL url = SURL.create(path);
|
SURL url = SURL.create(path);
|
||||||
try (InputStream remoteInputStream = url.openStream()) {
|
try (InputStream remoteInputStream = url.openStream()) {
|
||||||
|
if (remoteInputStream != null) {
|
||||||
lines = BlocLines.load(remoteInputStream, location);
|
lines = BlocLines.load(remoteInputStream, location);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
final SFile styleFile = FileSystem.getInstance().getFile(path);
|
final SFile styleFile = FileSystem.getInstance().getFile(path);
|
||||||
if (styleFile.exists()) {
|
if (styleFile.exists()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user