fix(uiSref): Check that state is defined in isMatch()

Fixes #1314
Fixes #1332