From 5735a575044c89413b7fcb5f63e32a6a434383ba Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 7 Mar 2023 10:09:34 +0100 Subject: [PATCH] Pcbnew: fix crash when loading a library with a ft containing a dimension. (crash due to the use of a null pointer during loading) --- pcbnew/pcb_dimension.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcbnew/pcb_dimension.cpp b/pcbnew/pcb_dimension.cpp index a26ee36a1c..83a453544e 100644 --- a/pcbnew/pcb_dimension.cpp +++ b/pcbnew/pcb_dimension.cpp @@ -209,7 +209,7 @@ void PCB_DIMENSION_BASE::SetUnitsMode( DIM_UNITS_MODE aMode ) case DIM_UNITS_MODE::AUTOMATIC: m_autoUnits = true; - m_units = GetBoard()->GetUserUnits(); + m_units = GetBoard() ? GetBoard()->GetUserUnits() : EDA_UNITS::MILLIMETRES; break; } }