From a5b1abc9a8cc668cdaeeea4efefa5db6b4fba4f7 Mon Sep 17 00:00:00 2001 From: Louis Royer Date: Sat, 28 Mar 2020 11:34:28 +0100 Subject: [PATCH] Add attribute null check --- src/serverP2P/FileWatcher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/serverP2P/FileWatcher.java b/src/serverP2P/FileWatcher.java index ce428ac..39877d2 100644 --- a/src/serverP2P/FileWatcher.java +++ b/src/serverP2P/FileWatcher.java @@ -124,7 +124,9 @@ public abstract class FileWatcher implements Runnable { */ public void setStop() { stop = true; - thread.interrupt(); + if (thread != null) { + thread.interrupt(); + } } /** Init sha512 map.