diff --git a/src/iso19111/operation/singleoperation.cpp b/src/iso19111/operation/singleoperation.cpp index 723dee31b6..ca34fd7255 100644 --- a/src/iso19111/operation/singleoperation.cpp +++ b/src/iso19111/operation/singleoperation.cpp @@ -4179,7 +4179,7 @@ bool SingleOperation::exportToPROJStringGeneric( const auto vertDst = dynamic_cast(targetCRS().get()); - if (!vertSrc) { + if (!vertDst) { throw io::FormattingException(concat( "Can apply ", methodName, " only to a target VerticalCRS")); }