Skip to content

Commit

Permalink
add runtime error check for null nexus feature
Browse files Browse the repository at this point in the history
  • Loading branch information
hellkite500 committed Nov 1, 2023
1 parent 370a140 commit ab4c10e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/core/Layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ namespace ngen
//TODO in a DENDRITIC network, only one destination nexus per catchment
//If there is more than one, some form of catchment partitioning will be required.
//for now, only contribute to the first one in the list
if(nexus == nullptr){
throw std::runtime_error("Invalid (null) nexus instantiation downstream of "+id+". "+SOURCE_LOC);
}
nexus->add_upstream_flow(response_m_h, id, output_time_index);
/*std::cerr << "Add water to nexus ID = " << nexus->get_id() << " from catchment ID = " << id << " value = "
<< response << ", ID = " << id << ", time-index = " << output_time_index << std::endl; */
Expand Down

0 comments on commit ab4c10e

Please sign in to comment.