diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2021-01-08 14:21:08 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-08 13:49:08 +0000 |
commit | 76c0776d7d3e77e07d74451454ef64cf80ca468b (patch) | |
tree | 9c0a39352854616965e5a0e3d36aaf889a4cb165 | |
parent | 09adb30a8e93187e1780700d1c756a553c9265aa (diff) |
Don't call a method on potential nullptr
Amends e7af10cfabeac5d049130f137f54a0b0c9f6fdc4
Task-number: QTBUG-89926
Change-Id: I5c1357f37dcb27bafef6975984958c9f686bc2b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit d1b6d15fdb143b2c4cc937f3e8ba234829eb517c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/designer/src/components/buddyeditor/buddyeditor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp index 7ad6c9eec..38a865cee 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp @@ -212,14 +212,14 @@ void BuddyEditor::setBackground(QWidget *background) { clear(); ConnectionEdit::setBackground(background); + if (background == nullptr) + return; const auto label_list = background->findChildren<QLabel*>(); for (QLabel *label : label_list) { const QString buddy_name = buddy(label, m_formWindow->core()); if (buddy_name.isEmpty()) continue; - if (background == nullptr) - continue; QWidget *target = background->findChild<QWidget*>(buddy_name); if (target == nullptr) continue; |