summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 70fd50ebd424..85a12654cb5a 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -263,7 +263,7 @@ ScVbaUserForm::getValue( const OUString& aPropertyName ) throw (beans::UnknownPr
{
uno::Reference< msforms::XControl > xVBAControl = ScVbaControlFactory::createUserformControl( mxContext, xControl, xDialogControl, m_xModel, mpGeometryHelper->getOffsetX(), mpGeometryHelper->getOffsetY() );
ScVbaControl* pControl = dynamic_cast< ScVbaControl* >( xVBAControl.get() );
- if ( !m_sLibName.isEmpty() )
+ if (pControl && !m_sLibName.isEmpty())
pControl->setLibraryAndCodeName( m_sLibName.concat( "." ).concat( getName() ) );
aResult = uno::makeAny( xVBAControl );
}