From 63823ccc76c96375a503b41f1b22eecf459f702b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Mar 2021 23:51:17 +0100 Subject: is2DPartOf3D(): catch potential exception (CID 314817) --- src/iso19111/crs.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp index 9c4c04c3..6bf607fa 100644 --- a/src/iso19111/crs.cpp +++ b/src/iso19111/crs.cpp @@ -2517,10 +2517,17 @@ bool GeographicCRS::is2DPartOf3D(util::nn other, util::IComparable::Criterion::EQUIVALENT))) { return false; } - const auto thisDatum = datumNonNull(dbContext); - const auto otherDatum = other->datumNonNull(dbContext); - return thisDatum->_isEquivalentTo(otherDatum.get(), - util::IComparable::Criterion::EQUIVALENT); + try { + const auto thisDatum = datumNonNull(dbContext); + const auto otherDatum = other->datumNonNull(dbContext); + return thisDatum->_isEquivalentTo( + otherDatum.get(), util::IComparable::Criterion::EQUIVALENT); + } catch (const util::InvalidValueTypeException &) { + // should not happen really, but potentially thrown by + // Identifier::Private::setProperties() + assert(false); + return false; + } } //! @endcond -- cgit v1.2.3