Fix settings crash when upgrading: make datasheetAsPdf nullable

The settings bundle stores values in the database. When upgrading from
a version without datasheetAsPdf, the stored JSON lacks this key,
causing a TypeError when assigning null to a non-nullable bool.
Making it nullable with a fallback in KiCadHelper fixes the upgrade path.
This commit is contained in:
Sebastian Almberg 2026-02-12 22:08:58 +01:00
parent 67c0b02248
commit 9de176e455
2 changed files with 2 additions and 2 deletions

View file

@ -47,5 +47,5 @@ class KiCadEDASettings
#[SettingsParameter(label: new TM("settings.misc.kicad_eda.datasheet_link"),
description: new TM("settings.misc.kicad_eda.datasheet_link.help"),
envVar: "bool:EDA_KICAD_DATASHEET_AS_PDF", envVarMode: EnvVarMode::OVERWRITE)]
public bool $datasheetAsPdf = true;
public ?bool $datasheetAsPdf = true;
}