Check for valid object existence before checking its session changed

flag in the data model.

Thanks Murtuza, and Harshal for reporting it.
pull/3/head
Ashesh Vashi 2016-05-16 18:28:19 +05:30
parent 76087f3df3
commit 8a7a8eb9aa
1 changed files with 1 additions and 1 deletions

View File

@ -366,7 +366,7 @@ function(_, pgAdmin, $, Backbone) {
if (session) {
if (res[k] instanceof Array) {
res[k] = JSON.stringify(res[k]);
} else if ((obj.sessChanged && obj.sessChanged()) || isNew) {
} else if ((obj && obj.sessChanged && obj.sessChanged()) || isNew) {
res[k] = obj && obj.toJSON(!isNew);
/*
* We will run JSON.stringify(..) only from the main object,