Skip to content

Commit

Permalink
merian-nodes: NodeIO: More assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
LDAP committed Aug 22, 2024
1 parent 5173e39 commit d21dad3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/merian-nodes/graph/node_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ class NodeIO {
std::is_base_of_v<TypedInputConnector<OutputConnectorType, ResourceAccessType>, T>,
bool> = true>
ResourceAccessType operator[](const std::shared_ptr<T>& input_connector) const {
assert(resource_for_input_connector(input_connector) &&
assert(input_connector && "input connector cannot be null");
assert((input_connector->optional || resource_for_input_connector(input_connector)) &&
"non-optional input connector is not connected. This should be prevented by the "
"Graph.");
assert((!input_connector->optional || resource_for_input_connector(input_connector)) &&
"optional input connector is not connected");
return input_connector->resource(resource_for_input_connector(input_connector));
}
Expand Down

0 comments on commit d21dad3

Please sign in to comment.