Fix NMS-5894: add a call to getNodeType() before comparing names