Fixed some sonarqube issues.

This commit is contained in:
Akshay Joshi
2020-06-17 19:30:56 +05:30
parent df05efd7d9
commit 5ed1e1e5b6
9 changed files with 11 additions and 18 deletions

View File

@@ -7,9 +7,6 @@
//
//////////////////////////////////////////////////////////////
//import * as commonUtils from '../../../static/js/utils';
//import Mousetrap from 'mousetrap';
define([
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
'backbone', 'alertify', 'backform', 'backgrid', 'sources/browser/generate_url',
@@ -357,7 +354,7 @@ define([
msg = undefined,
title = undefined;
if (sel_node.type && sel_node.type == 'coll-constraints') {
if (sel_node && sel_node.type && sel_node.type == 'coll-constraints') {
// In order to identify the constraint type, the type should be passed to the server
sel_rows = sel_row_models.map(row => ({id: row.get('oid'), _type: row.get('_type')}));
}
@@ -372,6 +369,9 @@ define([
return;
}
if (!sel_node)
return;
if (type === 'dropCascade') {
url = sel_node.generate_url(sel_item, 'delete');
msg = gettext('Are you sure you want to drop all the selected objects and all the objects that depend on them?');