aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-11-15 12:43:33 +0100
committerGitHub <noreply@github.com>2021-11-15 12:43:33 +0100
commitaeba9bdfe3beffc481b33d647ccf478df03c08a9 (patch)
tree11afdd02b39a5f1ddf6779dabec6d780f6acbe9c
parent97a5fad1f01bd3102768bcedaa88dbeb82e069b5 (diff)
parent4cb9fdb63148d1281bbecf30a645a26367a18985 (diff)
downloadPROJ-aeba9bdfe3beffc481b33d647ccf478df03c08a9.tar.gz
PROJ-aeba9bdfe3beffc481b33d647ccf478df03c08a9.zip
Merge pull request #2940 from OSGeo/backport-2938-to-8.2
[Backport 8.2] createOperationsCompoundToCompound(): fix null pointer dereference when connection to proj.db doesn't exist.
-rw-r--r--src/iso19111/operation/coordinateoperationfactory.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp
index 971e265a..3dc7e290 100644
--- a/src/iso19111/operation/coordinateoperationfactory.cpp
+++ b/src/iso19111/operation/coordinateoperationfactory.cpp
@@ -5263,8 +5263,10 @@ void CoordinateOperationFactory::Private::createOperationsCompoundToCompound(
// and a geoid model for Belfast height referenced to ETRS89
if (verticalTransforms.size() == 1 &&
verticalTransforms.front()->hasBallparkTransformation()) {
- auto dbContext =
- context.context->getAuthorityFactory()->databaseContext();
+ const auto &authFactory = context.context->getAuthorityFactory();
+ auto dbContext = authFactory
+ ? authFactory->databaseContext().as_nullable()
+ : nullptr;
const auto intermGeogSrc =
srcGeog->promoteTo3D(std::string(), dbContext);
const bool intermGeogSrcIsSameAsIntermGeogDst =