Open driversti opened 4 years ago
Thanks! It's my first Java app. What would you say is better practice?
Sometimes I get a null pointer exception when calling getAllBeaches, I wonder if this might be reason...
Of course. It would be better to operate on the object when you're sure that it exists.
https://github.com/dashakrolik/surf-forecast-backend/blob/0b46b33ff238589a958c0a0eea8954450bb063a1/src/main/java/com/ordina/surfforecast/service/BeachService.java#L85
Returning
null
is a bad practice.