diff options
-rw-r--r-- | comphelper/source/misc/documentiologring.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/comphelper/source/misc/documentiologring.cxx b/comphelper/source/misc/documentiologring.cxx index 5b943643bf2b..a2e9de1f7447 100644 --- a/comphelper/source/misc/documentiologring.cxx +++ b/comphelper/source/misc/documentiologring.cxx @@ -123,14 +123,17 @@ void SAL_CALL OSimpleLogRing::initialize( const uno::Sequence< uno::Any >& aArgu if ( !m_refCount ) throw uno::RuntimeException(); // the object must be refcounted already! - sal_Int32 nLen = 0; - if ( aArguments.getLength() == 1 && ( aArguments[0] >>= nLen ) && nLen ) - m_aMessages.realloc( nLen ); - else - throw lang::IllegalArgumentException( - OUString( "Nonnull size is expected as the first argument!" ), + if (aArguments.hasElements()) + { + sal_Int32 nLen = 0; + if ( aArguments.getLength() == 1 && ( aArguments[0] >>= nLen ) && nLen ) + m_aMessages.realloc( nLen ); + else + throw lang::IllegalArgumentException( + "Nonnull size is expected as the first argument!", uno::Reference< uno::XInterface >(), 0 ); + } m_bInitialized = sal_True; } |