Skip to content

Commit f4d689e

Browse files
committed
fix: Filter records with missing data and register a warning about it in the Strapi logs.
1 parent c0445de commit f4d689e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/config/type.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ const ConfigType = class ConfigType {
183183
await Promise.all(Object.values(AllConfig).map(async (config) => {
184184
const combinedUid = getCombinedUid(this.uidKeys, config);
185185
const combinedUidWhereFilter = getCombinedUidWhereFilter(this.uidKeys, config);
186+
187+
if (!combinedUid) {
188+
strapi.log.warn(logMessage(`Missing data for entity with id ${config.id} of type ${this.configPrefix}`));
189+
return;
190+
}
191+
186192
// Check if the config should be excluded.
187193
const shouldExclude = !isEmpty(strapi.config.get('plugin.config-sync.excludedConfig').filter((option) => `${this.configPrefix}.${combinedUid}`.startsWith(option)));
188194
if (shouldExclude) return;

0 commit comments

Comments
 (0)