diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-11-29 08:30:39 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:25:40 +0100 |
commit | 6c52d276c40a241153ad466fac8a0390ab3b241f (patch) | |
tree | 4e15bba71c74cc6af0781baef0f214554d12bd53 /vcl | |
parent | 2ef45f326802d1d6d7a5124495e0dbf5cb3512e5 (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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127681
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dialog.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 842c17dfcfbe..b707a72a8997 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1066,10 +1066,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 |