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