Check that state variable is defined in isMatch()

See #1314