Skip to content

Commit

Permalink
util: Fixed storage write exception for short object names
Browse files Browse the repository at this point in the history
  • Loading branch information
cederberg committed Jan 8, 2025
1 parent 114f434 commit 4a77cad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java/org/rapidcontext/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public static void setTempDir(File dir) {
public static File tempFile(String name) throws IOException {
String prefix = StringUtils.substringBeforeLast(name, ".");
String suffix = StringUtils.substringAfterLast(name, ".");
if (prefix == null || prefix.isBlank()) {
if (prefix == null || prefix.isBlank() || prefix.length() < 3) {
prefix = "file";
}
if (suffix != null && !suffix.isBlank()) {
Expand Down

0 comments on commit 4a77cad

Please sign in to comment.