diff --git a/app/crud/crud_station.py b/app/crud/crud_station.py index dad1d46..a24a79f 100644 --- a/app/crud/crud_station.py +++ b/app/crud/crud_station.py @@ -15,7 +15,8 @@ def get(self, db: Session, id: Any) -> Optional[Station]: station = cast( Station, db.query(self.model).filter(self.model.name == id).first() ) - station.species = binomial_only(station.species) + if station: + station.species = binomial_only(station.species) return station