Skip to content
Snippets Groups Projects
Commit fd74a727 authored by Victor Poughon's avatar Victor Poughon
Browse files

Fix coverity #1271592

parent e9455875
No related branches found
No related tags found
No related merge requests found
...@@ -195,9 +195,16 @@ std::string MapProjectionAdapter::GetParameter(const std::string& key) const ...@@ -195,9 +195,16 @@ std::string MapProjectionAdapter::GetParameter(const std::string& key) const
if (projectionName.compare("ossimTransMercatorProjection") == 0) if (projectionName.compare("ossimTransMercatorProjection") == 0)
{ {
const ossimTransMercatorProjection* tmProjection = dynamic_cast<const ossimTransMercatorProjection*>(this->GetMapProjection()); 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());
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment