diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-02-23 14:22:38 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-02-24 11:51:47 +0100 |
commit | 88d830929015e085a5532948170bebcdede98bb8 (patch) | |
tree | 29bc70f46d98b8934bcbb81c8ad3b45545b00b92 /src/widgets/dialogs | |
parent | 1f6dbbd53969837cc4ff59f39dbb4c06d700a689 (diff) |
Add null pointer check
The detailsText widget might be nullptr even if detailsButton is not.
Both are tested elsewhere in code, e.g. in the _q_buttonClicked
private slot, so be consistent.
Address static analyzer warning 00b85157447772462c3b8ffc1da0ae3a
Change-Id: Ib8c31b79653a6e8a9011692cb84ffaa2fb8047e7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qmessagebox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index b73b3c320d..2bc7acc23d 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -2043,7 +2043,7 @@ int QMessageBoxPrivate::showOldMessageBox(QWidget *parent, QMessageBox::Icon ico void QMessageBoxPrivate::retranslateStrings() { #if QT_CONFIG(textedit) - if (detailsButton) + if (detailsButton && detailsText) detailsButton->setLabel(detailsText->isHidden() ? ShowLabel : HideLabel); #endif } |