summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-06-02 14:38:17 +0200
committerSimon Rettberg2023-06-02 14:38:17 +0200
commit1739185e930ce00762684b8691a33552632bd8f9 (patch)
treed72e09faa6efeeb43a70b22626daae7365a96e8b
parent[server] Assign proper names to threads and thread pools (diff)
downloadtutor-module-1739185e930ce00762684b8691a33552632bd8f9.tar.gz
tutor-module-1739185e930ce00762684b8691a33552632bd8f9.tar.xz
tutor-module-1739185e930ce00762684b8691a33552632bd8f9.zip
[server] Fix possible NPE
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/FileServer.java4
1 files 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();