summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-11-29 08:30:39 +0100
committerAndras Timar <andras.timar@collabora.com>2021-12-09 13:22:17 +0100
commitae4b61024f460af3c38eac24539f16c934698ff6 (patch)
tree70a8c39d5cfab150fb04dd74a34d502c7fe675f7 /vcl
parenteb664f6d747798c768bb399994e19cab307ee63a (diff)
Warn instead of crash when mpDialogImpl is missing
In LOK case we have some issues with dialogs to solve. Try to not crash in release but warn. Change-Id: Ic966d2b317a4e454d1d164ae36a96327c435ae6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126020 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 74462fc1c7c5..54d12e8945db 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1067,10 +1067,20 @@ short Dialog::Execute()
OSL_FAIL( "Dialog::Execute() - Dialog destroyed in Execute()" );
}
- tools::Long nRet = mpDialogImpl->mnResult;
- mpDialogImpl->mnResult = -1;
+ assert(mpDialogImpl);
- return static_cast<short>(nRet);
+ if (mpDialogImpl)
+ {
+ tools::Long nRet = mpDialogImpl->mnResult;
+ mpDialogImpl->mnResult = -1;
+
+ return static_cast<short>(nRet);
+ }
+ else
+ {
+ SAL_WARN( "vcl", "Dialog::Execute() : missing mpDialogImpl " );
+ return 0;
+ }
}
// virtual