File Do-not-rely-on-the-existence-of-a-BOARD-object-in-pa.patch of Package kicad.8

From f88d98af247090ced0056101c4fdb65dc22e19a7 Mon Sep 17 00:00:00 2001
From: Thomas Pointhuber <thomas.pointhuber@gmx.at>
Date: Sun, 12 May 2024 18:30:49 +0200
Subject: [PATCH 1/2] Do not rely on the existence of a BOARD* object in
 padNeedsUpdate

This allows us to use this check in unit-tests without a board attached

(cherry picked from commit 21b6b5efbb01b7bff5b2db08ab619f9ffb272371)
---
 pcbnew/drc/drc_test_provider_library_parity.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pcbnew/drc/drc_test_provider_library_parity.cpp b/pcbnew/drc/drc_test_provider_library_parity.cpp
index d0e5f2c177..2693854a9e 100644
--- a/pcbnew/drc/drc_test_provider_library_parity.cpp
+++ b/pcbnew/drc/drc_test_provider_library_parity.cpp
@@ -243,7 +243,7 @@ bool padNeedsUpdate( const PAD* a, const PAD* b, REPORTER* aReporter )
         layerSettingsDiffer |= a->GetKeepTopBottom() != b->GetKeepTopBottom();
 
     // Trim layersets to the current board before comparing
-    LSET enabledLayers = a->GetBoard()->GetEnabledLayers();
+    LSET enabledLayers = a->GetBoard() ? a->GetBoard()->GetEnabledLayers() : LSET::AllLayersMask();
     LSET aLayers = a->GetLayerSet() & enabledLayers;
     LSET bLayers = b->GetLayerSet() & enabledLayers;
 
-- 
2.47.1

openSUSE Build Service is sponsored by