File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -282,13 +282,20 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
282
282
if ( fld.type () == QVariant::ByteArray && fld.typeName ().endsWith ( " .SDO_GEOMETRY" ) )
283
283
{
284
284
QByteArray *ba = static_cast <QByteArray*>( v.data () );
285
- unsigned char *copy = new unsigned char [ba->size ()];
286
- memcpy ( copy, ba->constData (), ba->size () );
285
+ if ( ba->size () > 0 )
286
+ {
287
+ unsigned char *copy = new unsigned char [ba->size ()];
288
+ memcpy ( copy, ba->constData (), ba->size () );
287
289
288
- QgsGeometry *g = new QgsGeometry ();
289
- g->fromWkb ( copy, ba->size () );
290
- v = g->exportToWkt ();
291
- delete g;
290
+ QgsGeometry *g = new QgsGeometry ();
291
+ g->fromWkb ( copy, ba->size () );
292
+ v = g->exportToWkt ();
293
+ delete g;
294
+ }
295
+ else
296
+ {
297
+ v = QVariant ( QVariant::String );
298
+ }
292
299
}
293
300
else if ( v.type () != fld.type () )
294
301
v = QgsVectorDataProvider::convertValue ( fld.type (), v.toString () );
You can’t perform that action at this time.
0 commit comments