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

@ -58,7 +58,7 @@ class KiCadHelper
KiCadEDASettings $kiCadEDASettings,
) {
$this->category_depth = $kiCadEDASettings->categoryDepth;
$this->datasheetAsPdf = $kiCadEDASettings->datasheetAsPdf;
$this->datasheetAsPdf = $kiCadEDASettings->datasheetAsPdf ?? true;
}
/**