fix blank filename issue

This commit is contained in:
PhilReact 2025-05-16 23:39:32 +03:00
parent 1c52c18d32
commit e1ea8d65f8

View File

@ -1765,7 +1765,7 @@ public String finalizeUpload(
if (path == null) { if (path == null) {
// See if we have a string instead // See if we have a string instead
if (string != null) { if (string != null) {
if (filename == null) { if (filename == null || filename.isBlank()) {
// Use current time as filename // Use current time as filename
filename = String.format("qortal-%d", NTP.getTime()); filename = String.format("qortal-%d", NTP.getTime());
} }
@ -1780,7 +1780,7 @@ public String finalizeUpload(
} }
// ... or base64 encoded raw data // ... or base64 encoded raw data
else if (base64 != null) { else if (base64 != null) {
if (filename == null) { if (filename == null || filename.isBlank()) {
// Use current time as filename // Use current time as filename
filename = String.format("qortal-%d", NTP.getTime()); filename = String.format("qortal-%d", NTP.getTime());
} }