diff --git a/login-debug.php b/login-debug.php
index dd782ff3c429253e1252df370964833f8436cc46..b2f67e1e38fd66b0aad3bf3596248eb6d9dc48f9 100644
--- a/login-debug.php
+++ b/login-debug.php
@@ -9,7 +9,9 @@
 **/
 
 function debug_login_auth_cookie_malformed($cookie, $scheme) {
-    error_log("LOGIN: auth_cookie_malformed: scheme={$scheme} cookie={$cookie}");
+    if ($cookie) {
+        error_log("LOGIN: auth_cookie_malformed: scheme={$scheme} cookie={$cookie}");
+    }
 }
 add_action('auth_cookie_malformed', 'debug_login_auth_cookie_malformed', 10, 2);