Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix: handle missing CO₂ Signal data safely#1551

Merged
softchris merged 1 commit intomicrosoft:mainfrom
anasahhm:main
Feb 6, 2026
Merged

Fix: handle missing CO₂ Signal data safely#1551
softchris merged 1 commit intomicrosoft:mainfrom
anasahhm:main

Conversation

@anasahhm
Copy link
Contributor

This PR addresses issue #1548
The displayCarbonUsage function now checks for missing carbonIntensity and fossilFuelPercentage values before using them. This prevents runtime errors when the CO₂ Signal API returns incomplete data.
-Added null-safe checks with early throw for missing data
-Added fallback UI message (“Data unavailable”)
-Added console warnings for debugging

The displayCarbonUsage function now includes null-safe checks to prevent runtime errors when CO₂ Signal API data is missing. Added user-facing fallback text and console warnings.
@anasahhm
Copy link
Contributor Author

@microsoft-github-policy-service agree

@anasahhm
Copy link
Contributor Author

Please address this PR .

@github-actions
Copy link

This PR has not seen any action for a while! Closing for now, but it can be reopened at a later date.

@softchris softchris merged commit 30c9441 into microsoft:main Feb 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants