@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.
- package/dist/cjs/delete-hooks.js +3 -0
- package/package.json +1 -1
- package/src/delete-hooks.js +5 -1
package/dist/cjs/delete-hooks.js
CHANGED
|
@@ -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
package/src/delete-hooks.js
CHANGED
|
@@ -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
|
-
|
|
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
|
}
|