diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-03-06 23:51:17 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-03-07 00:20:21 +0100 |
| commit | 63823ccc76c96375a503b41f1b22eecf459f702b (patch) | |
| tree | 5e9b43b69445495635d519e6b738b1dba37fd916 | |
| parent | ec67ee73d1274150c1034477d77c36a451b55823 (diff) | |
| download | PROJ-63823ccc76c96375a503b41f1b22eecf459f702b.tar.gz PROJ-63823ccc76c96375a503b41f1b22eecf459f702b.zip | |
is2DPartOf3D(): catch potential exception (CID 314817)
| -rw-r--r-- | src/iso19111/crs.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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<const GeographicCRS *> 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 |
