fix a getParentElementByTag bug~

fix: Uncaught TypeError: Cannot read property 'tagName' of null