[BUGFIX] Prevent Uncaught TypeError in ClickMenu.js 00/50300/2
authorBenni Mack <benni@typo3.org>
Fri, 21 Oct 2016 08:32:45 +0000 (10:32 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 21 Oct 2016 08:36:04 +0000 (10:36 +0200)
This patch prevent an Uncaught TypeError ClickMenu.js.
In case the reloadFrame parameter not exist, the variable res is null.
This is ok, because not in any case the parameter is set.

Resolves: #78329
Releases: master, 7.6
Change-Id: I8590a37c55ed794d62620af4c487b57a972761f7
Reviewed-on: https://review.typo3.org/50300
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/ClickMenu.js

index ffe6a73..694bf21 100644 (file)
@@ -100,7 +100,7 @@ define(['jquery'], function($) {
                $.ajax(url).done(function(response) {
                        if (!response.getElementsByTagName('data')[0]) {
                                var res = parameters.match(/&reloadListFrame=(0|1|2)(&|$)/);
-                               var reloadListFrame = parseInt(res[1], 0);
+                               var reloadListFrame = res !== null && parseInt(res[1], 0);
                                if (reloadListFrame) {
                                        var doc = reloadListFrame != 2 ? top.content.list_frame : top.content;
                                        doc.location.reload(true);