Skip to content
Snippets Groups Projects
Commit 15d2fd93 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH:avoid undefined behaviour when solar irradiance is not initialized

parent 7a370715
No related branches found
No related tags found
No related merge requests found
......@@ -78,8 +78,15 @@ ReduceSpectralResponse<TSpectralResponse , TRSR>
{
ValuePrecisionType res = itk::NumericTraits<ValuePrecisionType>::ZeroValue();
typename InputRSRType::SpectralResponseType* solarIrradiance;
if(m_ReflectanceMode)
{
solarIrradiance = this->m_InputSatRSR->GetSolarIrradiance();
if (solarIrradiance == 0)
{
itkExceptionMacro(<<"Error occurs getting solar irradiance. Solar irradiance is mandatory using the reflectance mode.");
}
}
typename VectorPairType::const_iterator it;
VectorPairType pairs = (m_InputSatRSR->GetRSR())[numBand]->GetResponse();
it = pairs.begin();
......
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