diff --git a/himan-plugins/source/visibility.cpp b/himan-plugins/source/visibility.cpp index f033139c..f88cdd39 100644 --- a/himan-plugins/source/visibility.cpp +++ b/himan-plugins/source/visibility.cpp @@ -87,6 +87,13 @@ void visibility::Calculate(shared_ptr> myTargetInfo, unsigned short level lowest_hybrid = util::CreateHybridLevel(myTargetInfo->Producer(), "last"); auto NInfo = Fetch(forecastTime, lowest_hybrid, NParam, forecastType, false); + if (!NInfo) + { + myThreadedLogger.Warning(fmt::format("Skipping step {}, level {}", static_cast(forecastTime.Step()), + static_cast(forecastLevel))); + return; + } + // Make sure that "stLimit" value matches the numbering scheme of the data double NScale = (NInfo->Param().Name() == "N-PRCNT" ? 100. : 1.); const double _stLimit = stLimit * NScale;