public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
Date: Fri, 14 Oct 2016 15:39:02 +0530
Message-ID: <CAM5-9D9CkiQ10Tdann6cA_LDmDcuiZLcNRtWvka0fLt5h3izcA@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

While clicking on Select2 control, it tries to destroy the control and thus
it doesn't get this object sometimes and throws error.

It should attempt to destroy the select2 object only if this object is not
undefined.
Adds proper check to handle the case.

Please find minor patch and review.

Thanks
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] select2_control_destroy_issue.patch (441B, 3-select2_control_destroy_issue.patch)
  download | inline diff:
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 1d96de0..b685b6c 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -1894,7 +1894,7 @@
     ].join("\n")),
     render: function() {
 
-      if(this.$sel && this.$sel.select2) {
+      if(this && this.$sel && this.$sel.select2) {
         this.$sel.select2('destroy');
       }
 


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: Select2 control destroy issue [Minor fix]
  In-Reply-To: <CAM5-9D9CkiQ10Tdann6cA_LDmDcuiZLcNRtWvka0fLt5h3izcA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox