Skip to content

Commit 559587a

Browse files
Merge pull request phpmyadmin#20206 from liviuconcioiu/19645
Fix phpmyadmin#19645 - Fix data is undefined
2 parents 9bf6498 + 9eb0265 commit 559587a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

js/src/navigation.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
166166
}
167167

168168
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
169-
if (typeof data !== 'undefined' && data.success === true) {
169+
if (typeof data === 'undefined') {
170+
return;
171+
}
172+
173+
if (data.success === true) {
170174
$destination.find('div.list_container').remove(); // FIXME: Hack, there shouldn't be a list container there
171175
if (isNode) {
172176
$destination.append(data.message);
@@ -191,7 +195,7 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
191195
if (callback && typeof callback === 'function') {
192196
callback(data);
193197
}
194-
} else if (typeof data !== 'undefined' && data.redirect_flag === '1') {
198+
} else if (data.redirect_flag === '1') {
195199
if (window.location.href.indexOf('?') === -1) {
196200
window.location.href += '?session_expired=1';
197201
} else {
@@ -939,7 +943,11 @@ Navigation.reload = function (callback, paths) {
939943

940944
function requestNaviReload (params) {
941945
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
942-
if (typeof data !== 'undefined' && data.success) {
946+
if (typeof data === 'undefined') {
947+
return;
948+
}
949+
950+
if (data.success) {
943951
$('#pma_navigation_tree').html(data.message).children('div').show();
944952
if ($('#pma_navigation_tree').hasClass('synced')) {
945953
Navigation.selectCurrentDatabase();

0 commit comments

Comments
 (0)