fix for delegateTagNameListener when getElementParentElement returns null within loop

...l within loop