VE-1592: Make sure that a node is element before calling getAttribute method on it