Skip to content

Commit

Permalink
update reste.js verify if response is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Jórdan Luiz Bisato committed Feb 15, 2018
1 parent 955935a commit ec9e583
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ var main = function() {

// if we have a config based transfor for th emodel
// then attach this to the model, or create a default
if (reste.modelConfig && reste.modelConfig[name] && reste.modelConfig[name].transform) {
if (reste.modelConfig && reste.modelConfig[name] && reste.modelConfig[name].transform) {
model.transform = function(model, transform) {
if (transform) {
this.__transform = transform(this);
Expand Down Expand Up @@ -471,6 +471,7 @@ var main = function() {

methodCall(options, function(response) {

if ((response != null) && (response != undefined)) {
if (options.success && response[collectionConfig.content]) {

// check if we have a return property
Expand All @@ -492,6 +493,9 @@ var main = function() {
Alloy.Collections[collectionConfig.name].trigger("sync");
}
}
} else {
option.success(null);
}
}, function(response) {
if (options.error) {
options.error(response);
Expand Down

0 comments on commit ec9e583

Please sign in to comment.