Skip to content

Commit

Permalink
Fix: Gridprofileparser: Add additional error handling if profile is u…
Browse files Browse the repository at this point in the history
…nknown
  • Loading branch information
tbnobody committed Dec 17, 2023
1 parent 3288b97 commit 4cae939
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Hoymiles/src/parser/GridProfileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ std::list<GridProfileSection_t> GridProfileParser::getProfile() const
break;
}

if (section_start == -1) {
section.SectionName = "Unknown";
break;
}

for (uint8_t val_id = 0; val_id < section_size; val_id++) {
auto itemDefinition = itemDefinitions.at(_profileValues[section_start + val_id].ItemDefinition);

Expand Down

0 comments on commit 4cae939

Please sign in to comment.