[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.