Skip to content

Commit

Permalink
Gui: Check for exising layout before accessing it
Browse files Browse the repository at this point in the history
It still must be checked if the crash in FreeCAD#18747 will be fixed.
  • Loading branch information
wwmayer committed Dec 27, 2024
1 parent 6bb424b commit 01a659e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Gui/DlgPreferencesImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ PreferencePage* DlgPreferencesImp::createPreferencePage(const std::string& pageN

auto resetMargins = [](QWidget* widget) {
widget->setContentsMargins(0, 0, 0, 0);
widget->layout()->setContentsMargins(0, 0, 0, 0);
if (auto layout = widget->layout()) {
layout->setContentsMargins(0, 0, 0, 0);
}
};

// settings layout already takes care for margins, we need to reset everything to 0
Expand Down

0 comments on commit 01a659e

Please sign in to comment.