mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Fix crash after running GDAL alg from processing (fixes #18004)
This was happening only with GDAL trunk Processing first tries to load output as a vector, then as a raster and output from raster algs would crash in OGR provider constructor due to null pointer
This commit is contained in:
parent
a7870afab1
commit
6096e5c25d
@ -469,9 +469,12 @@ QgsOgrProvider::QgsOgrProvider( QString const &uri )
|
||||
bool supportsBoolean = false;
|
||||
|
||||
#if GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,3,0)
|
||||
const char *pszDataTypes = GDALGetMetadataItem( mOgrOrigLayer->driver(), GDAL_DMD_CREATIONFIELDDATASUBTYPES, nullptr );
|
||||
if ( pszDataTypes && strstr( pszDataTypes, "Boolean" ) )
|
||||
supportsBoolean = true;
|
||||
if ( mOgrOrigLayer )
|
||||
{
|
||||
const char *pszDataTypes = GDALGetMetadataItem( mOgrOrigLayer->driver(), GDAL_DMD_CREATIONFIELDDATASUBTYPES, nullptr );
|
||||
if ( pszDataTypes && strstr( pszDataTypes, "Boolean" ) )
|
||||
supportsBoolean = true;
|
||||
}
|
||||
#else
|
||||
if ( mGDALDriverName == QLatin1String( "GeoJSON" ) ||
|
||||
mGDALDriverName == QLatin1String( "GML" ) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user