From 9537911b681be2b454b0c3bb96e18f4c9eb37896 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 23 Mar 2021 14:24:01 -0400 Subject: [PATCH] Add guard code in `locationsAt`, for testing entities with invalid loc --- modules/core/locations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/locations.js b/modules/core/locations.js index 0b1e18c6e..6295074df 100644 --- a/modules/core/locations.js +++ b/modules/core/locations.js @@ -239,7 +239,7 @@ export function coreLocations() { // _this.locationsAt = (loc) => { let result = {}; - _wp(loc, true).forEach(prop => result[prop.id] = prop.area); + (_wp(loc, true) || []).forEach(prop => result[prop.id] = prop.area); return result; };