summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-02-08 19:31:20 +0200
committerAndras Timar <andras.timar@collabora.com>2018-03-25 18:27:25 +0200
commit238316748ca29caf29ec69eca9b1a50ad36fa1af (patch)
tree5aae29eb41ef17c7000f3040f9a3835a2601f440 /basic
parenta82c57de51e8cfa06a744d9cc29cbece50443a7c (diff)
Decrease fragility in odd use cases with no current document
Change-Id: I9966166561d4c6e577f3f7e8e04572f97a0b295e Reviewed-on: https://gerrit.libreoffice.org/49450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> (cherry picked from commit 73256b918119e378c762f6a3d79d04f311a075cc)
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sbxmod.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index bebdc0ca1619..f68d541d69a9 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -409,7 +409,10 @@ uno::Reference< vba::XVBACompatibility > getVBACompatibility( const uno::Referen
bool getDefaultVBAMode( StarBASIC* pb )
{
- uno::Reference< vba::XVBACompatibility > xVBACompat = getVBACompatibility( getDocumentModel( pb ) );
+ uno::Reference< frame::XModel > xModel( getDocumentModel( pb ) );
+ if (!xModel.is())
+ return false;
+ uno::Reference< vba::XVBACompatibility > xVBACompat = getVBACompatibility( xModel );
return xVBACompat.is() && xVBACompat->getVBACompatibilityMode();
}