Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3593 from gerrieg/weather
Browse files Browse the repository at this point in the history
Weather: Fixed exception if degree is not in a valid range
  • Loading branch information
teichsta committed Dec 25, 2015
2 parents ee2a718 + e49746a commit 22d09a4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ public static double getHumidex(double temp, int humidity) {
* Returns the wind direction based on degree.
*/
public static String getWindDirection(Integer degree) {
if (degree < 0 || degree > 360) {
return null;
}
String[] directions = new String[] { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW",
"W", "WNW", "NW", "NNW" };

Expand Down

0 comments on commit 22d09a4

Please sign in to comment.