Commit 3b96dd0
Fix KeyError when active_user_count missing from API response
Reddit's API no longer consistently returns the `active_user_count`
field in subreddit data. Using dict bracket access (`d['active_user_count']`)
raises a KeyError when the field is absent. Switch to `d.get()` which
returns None for missing keys, allowing the existing fallback to -1.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent c117c4e commit 3b96dd0
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
0 commit comments