Skip to content

Commit

Permalink
fix: internal server error returned when latest weather data is not a…
Browse files Browse the repository at this point in the history
…vailable
  • Loading branch information
lihini committed Jan 6, 2024
1 parent 819e5f4 commit e43074e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/modules/weather-stations/weather-stations.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export class WeatherStationsController {
weatherStationId,
);

if (!weatherData) {
return {
weatherData: null,
pointsOfUser: null,
};
}

// Get points of the user of the weather station.
const pointsOfUser = await this.pointsService.findByUserId(
weatherData.author_user_id,
Expand Down

0 comments on commit e43074e

Please sign in to comment.