Commit fd74a727 authored by Victor Poughon's avatar Victor Poughon

Fix coverity #1271592

parent e9455875
......@@ -195,9 +195,16 @@ std::string MapProjectionAdapter::GetParameter(const std::string& key) const
if (projectionName.compare("ossimTransMercatorProjection") == 0)
{
const ossimTransMercatorProjection* tmProjection = dynamic_cast<const ossimTransMercatorProjection*>(this->GetMapProjection());
if (key.compare("ScaleFactor") == 0)
if (!tmProjection)
{
return Utils::ConvertToString(tmProjection->getScaleFactor());
itkExceptionMacro("Error casting object to ossimTransMercatorProjection.");
}
else
{
if (key.compare("ScaleFactor") == 0)
{
return Utils::ConvertToString(tmProjection->getScaleFactor());
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment