Check valid DOMElement existance before accessing it while updating the

menu updation.
This commit is contained in:
Murtuza Zabuawala 2016-06-02 15:01:01 +05:30 committed by Ashesh Vashi
parent 60208b7ae5
commit bf042d46a2

View File

@ -75,12 +75,12 @@ function(_, S, pgAdmin, $) {
*/
update: function(node, item) {
if (!this.$el.hasClass('disabled')) {
if (this.$el && !this.$el.hasClass('disabled')) {
this.$el.addClass('disabled');
}
this.is_disabled = this.disabled(node, item);
if (!this.is_disabled) {
if (this.$el && !this.is_disabled) {
this.$el.removeClass('disabled');
}