Skip to content
Permalink
Browse files

Guard against nullptr

  • Loading branch information
nyalldawson committed May 13, 2019
1 parent 2ec429c commit 958dbb13ca2a792b637bf9871e7f52b04fec2f71
Showing with 7 additions and 6 deletions.
  1. +7 −6 src/core/qgscoordinatereferencesystem.cpp
@@ -80,14 +80,15 @@ QString getFullProjString( PJ *obj )
// see https://lists.osgeo.org/pipermail/proj/2019-May/008565.html, it's not sufficient to just
// use proj_as_proj_string
QgsProjUtils::proj_pj_unique_ptr boundCrs( proj_crs_create_bound_crs_to_WGS84( QgsProjContext::get(), obj, nullptr ) );
if ( const char *proj4src = proj_as_proj_string( QgsProjContext::get(), boundCrs.get(), PJ_PROJ_4, nullptr ) )
if ( boundCrs )
{
return QString( proj4src );
}
else
{
return QString( proj_as_proj_string( QgsProjContext::get(), obj, PJ_PROJ_4, nullptr ) );
if ( const char *proj4src = proj_as_proj_string( QgsProjContext::get(), boundCrs.get(), PJ_PROJ_4, nullptr ) )
{
return QString( proj4src );
}
}

return QString( proj_as_proj_string( QgsProjContext::get(), obj, PJ_PROJ_4, nullptr ) );
}
#endif
//--------------------------

0 comments on commit 958dbb1

Please sign in to comment.
You can’t perform that action at this time.