Skip to content

Commit

Permalink
Merge pull request #3439 from jamezp/RESTEASY-3290-3.15
Browse files Browse the repository at this point in the history
[RESTEASY-3290] Avoid an NPE if the temporary directory is null.
  • Loading branch information
jamezp committed Feb 22, 2023
2 parents fa02ba8 + c0d291c commit 32c25a4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ private static class CustomTempFileStorageProvider extends AbstractStorageProvid
}

public StorageOutputStream createStorageOutputStream() throws IOException {
Path file = Files.createTempFile(directory.toPath(), prefix, suffix);
Path file;
if (directory != null) {
file = Files.createTempFile(directory.toPath(), prefix, suffix);
} else {
file = Files.createTempFile(prefix, suffix);
}

return new TempFileStorageOutputStream(file);
}
Expand Down

0 comments on commit 32c25a4

Please sign in to comment.