@bedrockio/model 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -244,6 +244,9 @@ async function deleteLocalReferences(doc, arr) {
244
244
  for (let name of arr) {
245
245
  await doc.populate(name);
246
246
  const value = doc.get(name);
247
+ if (!value) {
248
+ continue;
249
+ }
247
250
  const arr = Array.isArray(value) ? value : [value];
248
251
  for (let sub of arr) {
249
252
  await sub.delete();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrockio/model",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Bedrock utilities for model creation.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -235,9 +235,13 @@ async function deleteLocalReferences(doc, arr) {
235
235
  }
236
236
  for (let name of arr) {
237
237
  await doc.populate(name);
238
+
238
239
  const value = doc.get(name);
239
- const arr = Array.isArray(value) ? value : [value];
240
+ if (!value) {
241
+ continue;
242
+ }
240
243
 
244
+ const arr = Array.isArray(value) ? value : [value];
241
245
  for (let sub of arr) {
242
246
  await sub.delete();
243
247
  }