fix undefined split function exception
This commit is contained in:
@@ -383,9 +383,10 @@ class Indexer {
|
||||
|
||||
const parsedPrice = parsePrice(price);
|
||||
|
||||
const locationArray = location.split(",");
|
||||
const region = locationArray[0];
|
||||
const municipality = locationArray[1];
|
||||
const locationArray =
|
||||
location && location.length > 0 ? location.split(",") : [];
|
||||
const region = locationArray.length > 0 ? locationArray[0] : "";
|
||||
const municipality = locationArray.length > 1 ? locationArray[1] : "";
|
||||
|
||||
const data = {
|
||||
realEstateType: this.getCategoryId(realEstateType),
|
||||
|
||||
Reference in New Issue
Block a user