diff --git a/python/ribasim/ribasim/model.py b/python/ribasim/ribasim/model.py index 7457b4b45..d46b648b0 100644 --- a/python/ribasim/ribasim/model.py +++ b/python/ribasim/ribasim/model.py @@ -307,7 +307,7 @@ def write(self, filepath: str | PathLike[str]) -> Path: if self.use_validation: self._validate_model() - if self.edge.df.subnetwork_id.notna().any(): + if self.edge.df is not None and self.edge.df["subnetwork_id"].notna().any(): warnings.warn( "Sources for allocation are automatically inferred and no longer have to be specified in the `Edge` table.", DeprecationWarning,