diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index e96a558544c694d3955a1feb4916743b717b7cef..13aa7869351316da1d0869be1f4b75c75fc8a084 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -1538,7 +1538,7 @@ net_wm_state_is_cb(bool (*cb)(Atom))
 				break;
 			}
 			ret = (Atom *)prop;
-			if (cb(*ret))
+			if (nir > 0 && cb(*ret))
 				is = true;
 			x11.XFree(prop);
 			if (is)