Skip to content

Commit 23eb818

Browse files
authored
Merge pull request #22 from TourCMS/release/1.2.1
Release/1.2.1
2 parents 1d23ff7 + e105a1d commit 23eb818

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

node-tourcms.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,13 +1167,15 @@ TourCMS.prototype.showCustomer = function(a) {
11671167

11681168
// Sanitise response, tours is an array if empty
11691169
a.processor = function(response, callback) {
1170-
1171-
// Ensure we have an array of custom fields
1172-
if(typeof response.customer.custom_fields !== "undefined")
1173-
response.customer.custom_fields.field = [].concat(response.customer.custom_fields.field);
1174-
else
1175-
response.customer.custom_fields = {field:[]};
1176-
1170+
1171+
if(response.error == "OK" && response.customer){
1172+
// Ensure we have an array of custom fields
1173+
if(typeof response.customer.custom_fields !== "undefined")
1174+
response.customer.custom_fields.field = [].concat(response.customer.custom_fields.field);
1175+
else
1176+
response.customer.custom_fields = {field:[]};
1177+
}
1178+
11771179
callback(response);
11781180

11791181
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"api"
77
],
88
"homepage": "https://github.com/tourcms/node-tourcms",
9-
"version": "1.2.0",
9+
"version": "1.2.1",
1010
"author": "TourCMS <[email protected]> (http://www.tourcms.com)",
1111
"contributors": [
1212
"Paul Slugocki <[email protected]> (https://github.com/paulslugocki)"

0 commit comments

Comments
 (0)