diff --git a/languagetool-core/src/main/java/org/languagetool/rules/patterns/PasswordAuthenticator.java b/languagetool-core/src/main/java/org/languagetool/rules/patterns/PasswordAuthenticator.java
index <HASH>..<HASH> 100644
--- a/languagetool-core/src/main/java/org/languagetool/rules/patterns/PasswordAuthenticator.java
+++ b/languagetool-core/src/main/java/org/languagetool/rules/patterns/PasswordAuthenticator.java
@@ -32,6 +32,9 @@ public class PasswordAuthenticator extends Authenticator {
 
   @Override
   protected PasswordAuthentication getPasswordAuthentication() {
+    if (getRequestingURL() == null) {
+      return null;
+    }
     String userInfo = getRequestingURL().getUserInfo();
     if (StringTools.isEmpty(userInfo)) {
       return null;
avoid NPE which can occur under some (unclear) conditions