Resolves: tdf#126134 EndDialog on disposed dialog

Change-Id: I079fb2bb786b66b843e8e3960643cf2db6387c79
Reviewed-on: https://gerrit.libreoffice.org/74822
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index faa88a2..961cd28 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1122,7 +1122,7 @@ void Dialog::RemoveFromDlgList()

void Dialog::EndDialog( long nResult )
{
    if ( !mbInExecute )
    if (!mbInExecute || IsDisposed())
        return;

    const bool bModal = GetType() != WindowType::MODELESSDIALOG;