@fourlights/strapi-plugin-deep-populate 1.11.0 → 1.11.1-beta.0

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.
@@ -18518,7 +18518,7 @@ const register = async ({ strapi: strapi2 }) => {
18518
18518
  return result;
18519
18519
  });
18520
18520
  };
18521
- const version = "1.11.0";
18521
+ const version = "1.11.1-beta.0";
18522
18522
  const sanitizeObject = (obj) => {
18523
18523
  if (obj === null || typeof obj !== "object") return obj;
18524
18524
  const dangerousProps = ["__proto__", "constructor", "prototype"];
@@ -18760,7 +18760,13 @@ async function _populate({
18760
18760
  ...params
18761
18761
  }) {
18762
18762
  const newPopulate = {};
18763
- let relations = getRelations(strapi.getModel(schema2));
18763
+ const model = strapi.getModel(schema2);
18764
+ if (!model) {
18765
+ console.warn(`[Plugin: Deep Populate] Could not find model for contentType: '${schema2}'`);
18766
+ console.warn("Please create a bug report and share the troublesome contentType.");
18767
+ return true;
18768
+ }
18769
+ let relations = getRelations(model);
18764
18770
  let currentPopulate = cloneDeep__default.default(populate2);
18765
18771
  resolvedRelations.set(params.documentId, true);
18766
18772
  for (const [attrName, attr] of relations) {
@@ -18490,7 +18490,7 @@ const register = async ({ strapi: strapi2 }) => {
18490
18490
  return result;
18491
18491
  });
18492
18492
  };
18493
- const version = "1.11.0";
18493
+ const version = "1.11.1-beta.0";
18494
18494
  const sanitizeObject = (obj) => {
18495
18495
  if (obj === null || typeof obj !== "object") return obj;
18496
18496
  const dangerousProps = ["__proto__", "constructor", "prototype"];
@@ -18732,7 +18732,13 @@ async function _populate({
18732
18732
  ...params
18733
18733
  }) {
18734
18734
  const newPopulate = {};
18735
- let relations = getRelations(strapi.getModel(schema2));
18735
+ const model = strapi.getModel(schema2);
18736
+ if (!model) {
18737
+ console.warn(`[Plugin: Deep Populate] Could not find model for contentType: '${schema2}'`);
18738
+ console.warn("Please create a bug report and share the troublesome contentType.");
18739
+ return true;
18740
+ }
18741
+ let relations = getRelations(model);
18736
18742
  let currentPopulate = cloneDeep$1(populate2);
18737
18743
  resolvedRelations.set(params.documentId, true);
18738
18744
  for (const [attrName, attr] of relations) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.11.0",
2
+ "version": "1.11.1-beta.0",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "strapi-plugin",