[Monitor Service | master]: IndicatorController.java: In method "createSectionsAndSaveBulk()" -on import indicators- check if a section or an indicator is null, and ignore them.

This commit is contained in:
Konstantina Galouni 2023-07-10 18:00:27 +03:00
parent 7b4f0a9eec
commit fc2010e530
1 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,10 @@ public class IndicatorController {
private void createSectionsAndSaveBulk(Date date, List<Section<Indicator>> old_sections,
Stakeholder stakeholder, String topicId, String categoryId, String subcategoryId) throws UnsupportedEncodingException {
for(Section<Indicator> section : old_sections) {
if(section == null) {
continue;
}
Section chart_section = null;
Section number_section = null;
@ -87,6 +91,10 @@ public class IndicatorController {
List<Indicator> indicators = section.getIndicators();
for (Indicator indicator : indicators) {
if(indicator == null) {
continue;
}
if (indicator.getType().equals("chart")) {
saveIndicatorAndAddInSection(indicator, date, stakeholder, subcategoryId, chart_section, chart_indicators);