Fixed bug #13118: Toggle empty tree produces JS error (Thanks to Felix Oertel)
authorSteffen Kamper <info@sk-typo3.de>
Mon, 4 Jan 2010 19:13:02 +0000 (19:13 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 4 Jan 2010 19:13:02 +0000 (19:13 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6719 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/js/tree.js

index 34632ff..56d4bc1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-01-04  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #13118: Toggle empty tree produces JS error (Thanks to Felix Oertel)
        * Fixed bug #12946: t3lib_div::readLLfile use debug output
 
 2010-01-04  Benjamin Mack  <benni@typo3.org>
index 04b283a..386a815 100644 (file)
@@ -50,7 +50,9 @@ var Tree = {
                // without waiting for the response
                if (!isExpand) {
                        var ul = obj.parentNode.parentNode.getElementsByTagName('ul')[0];
-                       obj.parentNode.parentNode.removeChild(ul); // no remove() directly because of IE 5.5
+                       if (ul) {
+                               obj.parentNode.parentNode.removeChild(ul); // no remove() directly because of IE 5.5
+                       }
                        var pm = Selector.findChildElements(obj.parentNode, ['.pm'])[0]; // Getting pm object by CSS selector (because document.getElementsByClassName() doesn't seem to work on Konqueror)
                        if (pm) {
                                pm.onclick = null;