Skip to content

Commit 52cf6a7

Browse files
committed
[UNDERTOW-2271] Fix the findbugs error (NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE)
Signed-off-by: Flavia Rainone <[email protected]>
1 parent 1f67f7a commit 52cf6a7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/main/java/io/undertow/server/handlers/form/MultiPartParserDefinition.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ public void data(final ByteBuffer buffer) throws IOException {
351351
@Override
352352
public void endPart() {
353353
if (file != null) {
354-
data.add(currentName, file, fileName != null ? fileName : file.getFileName().toString(), headers);
354+
if (fileName != null) {
355+
data.add(currentName, file, fileName, headers);
356+
} else {
357+
final Path fileNamePath = file.getFileName();
358+
data.add(currentName, file, fileNamePath != null ? fileNamePath.toString() : "", headers);
359+
}
355360
file = null;
356361
contentBytes.reset();
357362
try {

0 commit comments

Comments
 (0)