mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-11-28 18:28:04 -08:00
api.weather.gov returns HTTP 200 for offshore marine stations (forecastOffice NH2) but with gridId, gridX and gridY all explicitly null -- those locations have no land grid. getAndFormatPoint copied those fields through unchecked, so it returned a truthy object with null fields. The caller's `if (!point)` guard cannot catch that, and the request is built as https://api.weather.gov/gridpoints/null/null,null/forecast https://api.weather.gov/gridpoints/null/null,null/stations?limit=10 both of which 404. Validate the grid fields rather than just the wrapper object and return null when any are missing, so the affected city is skipped and drops off the regional map -- the same outcome the module already produces for a point that fails to load. Reproduces against the live API with stations KGHB ("GB172") and KVAF ("East Breaks 643"), and is visible in tests/index.mjs on Houston and San Antonio, whose regional maps include Gulf platforms.