StatPanels: Fixed possible migration issue (#21681)

This commit is contained in:
Torkel Ödegaard 2020-01-24 07:46:33 +01:00 committed by GitHub
parent b3d5e678f4
commit 8266959681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,11 +151,10 @@ export function sharedSingleStatMigrationHandler(panel: PanelModel<SingleStatBas
// Migrate color from simple string to a mode
const { defaults } = fieldOptions;
if (defaults.color) {
const old = defaults.color;
if (defaults.color && typeof defaults.color === 'string') {
defaults.color = {
mode: FieldColorMode.Fixed,
fixedColor: old,
fixedColor: defaults.color,
};
}