From 1739185e930ce00762684b8691a33552632bd8f9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 2 Jun 2023 14:38:17 +0200 Subject: [server] Fix possible NPE --- .../src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java index 0d283848..597e4306 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java @@ -84,7 +84,7 @@ public class FileServer implements IncomingEvent { @Override public void incomingDownloadRequest(Uploader uploader) throws IOException { String token = uploader.getToken(); - OutgoingDataTransfer download = downloads.get(token); + OutgoingDataTransfer download = token == null ? null : downloads.get(token); if (download == null) { LOGGER.warn("Download request: Unknown token " + token); uploader.cancel(); @@ -98,7 +98,7 @@ public class FileServer implements IncomingEvent { @Override public void incomingUploadRequest(Downloader downloader) throws IOException { String token = downloader.getToken(); - IncomingDataTransfer upload = uploads.get(token); + IncomingDataTransfer upload = token == null ? null : uploads.get(token); if (upload == null) { LOGGER.warn("Upload request: Unknown token " + token); downloader.cancel(); -- cgit v1.2.3-55-g7522