[BUGFIX] Defensive check in _addMetamorphCheck to prevent exception  #52...

Added check to return out of func if either DOM query returns null. 

Closes #5233.
Closes #5080.
I agree, it seems that this should still assert (but not fail as your error report in #5233).