Panels: avoid crash while switching between panels types (#35286)

This commit is contained in:
Ryan McKinley 2021-06-04 12:11:04 -07:00 committed by GitHub
parent 64f5f91d44
commit 351400b82e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,7 +198,9 @@ export function restoreCustomOverrideRules(current: FieldConfigSource, old: Fiel
if (isCustomFieldProp(prop)) {
const currentOverride = result.overrides.find((o) => isEqual(o.matcher, override.matcher));
if (currentOverride) {
currentOverride.properties.push(prop);
if (currentOverride !== override) {
currentOverride.properties.push(prop);
}
} else {
result.overrides.push(override);
}