Skip to content
Snippets Groups Projects
Commit 2b2ac615 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

address fix

parent 1c8244be
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,6 @@ WsValidationUtils.validate = function(pValue, pType, pCountry, pCity)
*/
WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
{
logging.log(JSON.stringify(vars.getString("$this.value"), null, "\t"))
try
{
var data = JSON.parse(vars.getString("$this.value"));
......@@ -280,11 +279,10 @@ WsValidationUtils.setAddressFields = function(pFieldToSetToValue)
// ignore error
return
}
logging.log(JSON.stringify(typeof data, null, "\t"))
var type = typeof data;
// Only an array can be returned by the ws. V-- this check is slow -> check number and string before
if (type == "number" || type == "string" || Object.prototype.toString.call(data) !== '[object Array]')
// Only an array can be returned by the ws. V-- this check is slow -> check if not object before as its faster
if (type != "object" || Object.prototype.toString.call(data) !== '[object Array]')
return
_setField("$field.ZIP", data[1]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment