Skip to content

Fix crash when payload.type is undefined (Weather.gov incompatability)#28

Open
Aws505 wants to merge 1 commit intoBrianHepler:masterfrom
Aws505:fix-weather-type-undefined
Open

Fix crash when payload.type is undefined (Weather.gov incompatability)#28
Aws505 wants to merge 1 commit intoBrianHepler:masterfrom
Aws505:fix-weather-type-undefined

Conversation

@Aws505
Copy link
Copy Markdown

@Aws505 Aws505 commented Nov 28, 2025

The module currently crashes when used with the default MagicMirror weather module using the Weather.gov provider, because payload.type is undefined.

This PR implements a safe fallback for the weather condition:

  • payload.type
  • payload.weatherType
  • payload.current.weather[0].main
  • default: "clouds"

This restores Unsplash queries and prevents module failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant