From c816cb847da9a3302f23e113171c81fed6b319c0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 22 Oct 2018 16:21:12 +0100 Subject: pvs-studio: V571 Recurring check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1ad7bcfa557b38488adf26b434433e6bae259f43 Reviewed-on: https://gerrit.libreoffice.org/62190 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- connectivity/source/commontools/dbtools.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'connectivity/source') diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index b8b8a4cdd29b..26e2c604a230 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -591,16 +591,13 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect eState = FAILED; OSL_ENSURE( xObjectCollection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection (no sdb.Connection, or no Tables-/QueriesSupplier)!"); - if ( xObjectCollection.is() ) + if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) ) { - if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) ) - { - xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns; - // (xSupplyColumns being NULL will be handled in the next state) + xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns; + // (xSupplyColumns being NULL will be handled in the next state) - // next: go for the columns - eState = RETRIEVE_COLUMNS; - } + // next: go for the columns + eState = RETRIEVE_COLUMNS; } break; -- cgit