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

(cherry picked from commit 351400b82e)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2021-06-04 21:36:57 +02:00
committed by GitHub
co-authored by Ryan McKinley
parent 557c310c8c
commit d76bcd082f
@@ -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);
}