diff --git a/src/apps/projinfo.cpp b/src/apps/projinfo.cpp index a7419fbfb5..d76c88a5e5 100644 --- a/src/apps/projinfo.cpp +++ b/src/apps/projinfo.cpp @@ -1221,9 +1221,10 @@ static void suggestCompletion(const std::vector &args) { const auto columnPos = args.back().find(':'); if (columnPos != std::string::npos) { const auto authName = args.back().substr(0, columnPos); - const auto codeStart = columnPos + 1 < args.back().size() - ? args.back().substr(columnPos + 1) - : std::string(); + const std::string codeStart = + columnPos + 1 < args.back().size() + ? args.back().substr(columnPos + 1) + : std::string(); auto factory = AuthorityFactory::create(dbContext, authName); const auto list = factory->getCRSInfoList(); @@ -1242,7 +1243,7 @@ static void suggestCompletion(const std::vector &args) { // If there is a single match, remove the name from the // suggestion. res.clear(); - res.push_back(code); + res.push_back(std::move(code)); } for (const auto &val : res) { if (!first) diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp index fa9a9be56c..d92ba1fe23 100644 --- a/src/iso19111/operation/coordinateoperationfactory.cpp +++ b/src/iso19111/operation/coordinateoperationfactory.cpp @@ -4253,9 +4253,12 @@ CoordinateOperationFactory::Private::createOperationsGeogToVertFromGeoid( std::vector accuracies; const auto &modelAccuracies = model->coordinateOperationAccuracies(); - std::vector transformationsForGrid = - io::DatabaseContext::getTransformationsForGridName( - authFactory->databaseContext(), projFilename); + std::vector transformationsForGrid; + if (authFactory) { + transformationsForGrid = + io::DatabaseContext::getTransformationsForGridName( + authFactory->databaseContext(), projFilename); + } // Only select transformations whose datum of the target vertical // CRS match the one of the target vertical CRS of interest (when