Skip to content

Commit

Permalink
Handle empty memory IDs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
SolraBizna committed Oct 4, 2017
1 parent 03054ac commit 12fb420
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/devcart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace {
}
else overlay_override = false;
std::array<std::string, NUM_DIP_CONFIGURATIONS> chips;
for(auto& c : chips) c = "open";
for(unsigned int i = 0; i < NUM_DIP_GROUPS; ++i) {
std::string q;
q.push_back('0' + i);
Expand All @@ -61,7 +62,7 @@ namespace {
dips_and_shifts[i] = j | (shift << UNSHIFT_SHIFT);
break;
}
else if(chips[j].empty()) {
else if(chips[j] == "open") {
auto p = memories.find(id);
if(p == memories.end())
throw sn.Get("BOARD_DEVCART_MEMORY_ID_UNKNOWN"_Key, {q});
Expand Down

0 comments on commit 12fb420

Please sign in to comment.