Null pointer bugfix
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 16 Jun 2025 19:28:49 +0000 (22:28 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 16 Jun 2025 19:28:49 +0000 (22:28 +0300)
src/main/java/eu/svjatoslav/alyverkko_cli/commands/mail_correspondant/MailCorrespondentCommand.java

index 3956628..e336743 100644 (file)
@@ -136,11 +136,12 @@ public class MailCorrespondentCommand implements Command {
             if (key != null) {
                 System.out.println("Detected filesystem events in mail directory. Processing ... ");
                 processDetectedFilesystemEvents(key);
-            }
 
-            if (!key.reset()) {
-                break;
+                if (!key.reset()) {
+                    break;
+                }
             }
+
         }
 
         directoryWatcher.close();