Skip to content

Null GamerScore causes crash and UI freeze on startup #3

Description

@sharkusmanch

CountAchievements() crashes when processing games without a GamerScore value (Steam, GOG, etc.). The cast at line 281:

double score = (double)item["GamerScore"];

throws InvalidCastException for null values. The exception is caught by the outer try-catch, but this happens for every non-Xbox/RetroAchievements game in the library — thousands of times per startup.

02-02 20:00:32.495|ERROR|SuccessStoryFullscreenHelper#SuccessStoryFullscreenHelper:Failed to process file: C:\Users\theme\AppData\Roaming\Playnite\ExtensionsData\cebe6d32-8c46-4459-b993-5a5189d60788\SuccessStory\f5f3fa30-2bf6-4ce9-bf16-4f8fc8f39d11.json
   at SuccessStoryFullscreenHelper.SuccessStoryFullscreenHelper.CountAchievements() in C:\Downloads\Plugins\SuccessStoryFullscreenHelper\SuccessStoryFullscreenHelper.cs:line 305
02-02 20:00:32.495|ERROR|SuccessStoryFullscreenHelper#SuccessStoryFullscreenHelper:Failed to process file: C:\Users\theme\AppData\Roaming\Playnite\ExtensionsData\cebe6d32-8c46-4459-b993-5a5189d60788\SuccessStory\f684a3fb-2c31-4527-a39e-39f8ab45a33c.json
   at SuccessStoryFullscreenHelper.SuccessStoryFullscreenHelper.CountAchievements() in C:\Downloads\Plugins\SuccessStoryFullscreenHelper\SuccessStoryFullscreenHelper.cs:line 305
02-02 20:00:32.575|INFO |SuccessStoryFullscreenHelper#SuccessStoryFullscreenHelper:SuccessStory stats loaded from 3301 files. Bronze: 1363, Silver: 584, Gold: 367, Platinum: 95, Total: 2409

Additionally, CountAchievements() runs synchronously in OnApplicationStarted, blocking the UI thread during all file I/O and JSON parsing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions