Skip to content

Commit dc791fd

Browse files
committedApr 8, 2016
oracle provider: handle empty geometries (fixes #14631)
(cherry picked from commit d07bc18)
1 parent 28d2547 commit dc791fd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
 

‎src/providers/oracle/qgsoraclefeatureiterator.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,19 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
190190
(( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) != 0 && ( !mConnection->hasSpatial() || !mSource->mHasSpatialIndex ) ) )
191191
{
192192
QByteArray *ba = static_cast<QByteArray*>( mQry.value( col++ ).data() );
193-
unsigned char *copy = new unsigned char[ba->size()];
194-
memcpy( copy, ba->constData(), ba->size() );
193+
if ( ba->size() > 0 )
194+
{
195+
unsigned char *copy = new unsigned char[ba->size()];
196+
memcpy( copy, ba->constData(), ba->size() );
195197

196-
QgsGeometry *g = new QgsGeometry();
197-
g->fromWkb( copy, ba->size() );
198-
feature.setGeometry( g );
198+
QgsGeometry *g = new QgsGeometry();
199+
g->fromWkb( copy, ba->size() );
200+
feature.setGeometry( g );
201+
}
202+
else
203+
{
204+
feature.setGeometry( 0 );
205+
}
199206

200207
if (( mRequest.flags() & QgsFeatureRequest::ExactIntersect ) != 0 && ( !mConnection->hasSpatial() || !mSource->mHasSpatialIndex ) &&
201208
mRequest.filterType() == QgsFeatureRequest::FilterRect &&

0 commit comments

Comments
 (0)
Please sign in to comment.