PC [BUG] Game crashes when Bluetooth controller unexpectedly disconnects

The issue:
Stardew Valley crashes when a Bluetooth game controller unexpectedly disconnects (as the controller does if there's been no input for however many minutes). This appears to happen consistently, with the game crashing every time an unexpected controller disconnection occurs. The issue appears to be specific to Stardew Valley, with no other Steam games causing similar issues.

I've compiled a small list of other examples of what appears to be the same issue, from this forum and elsewhere on the web:
Moderator 'Odin' confirms reports of controller disconnects causing crashes [Jan 1, 2021].
Potentially the same issue is described in this thread here too [Feb 7, 2021].
A thread further describing reports that Bluetooth disconnects can crash the game [Jul 26, 2021].
Steam Community bug report describing what appears to be the same issue, noting CPU usage spikes [Apr 12, 2020].
Reddit post describing a similar Bluetooth controller issue causing crashes - interestingly issue appears on Windows 10 for this user [Apr 26, 2021].
Another reddit post describing issues with Bluetooth disconnects causing crashes [Dec 24, 2020].
Steam Community bug report describing crashes when Bluetooth mouse unexpectedly disconnects [Dec 24, 2016].

Error text:
Screenshot 2021-08-21 at 12.39.44.png

The above alert box (Developer Tools Access needs to take control of another process for debugging to continue) appears over the game window. Clicking 'Cancel' to dismiss it seems to trigger an identical alert box, after hitting 'Cancel' to dismiss about 10 times the game unexpectedly quits.

Game version:
Stardew Valley version 1.5.4 installed via Steam running on macOS Big Sur version 11.4 (20F71) on a MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports).

Game language:
English

Single-player or multiplayer:
Only observed in single-player, but not tested in multiplayer.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This issue is affecting me frequently. I put the controller down for a few minutes to go make tea/to the toilet/whatever and upon returning the game's crashed and I've lost that days progress. Needless to say it's very frustrating.

I was loathe to have to create an account on this forum in order to submit this bug report. I really just want to play and enjoy the game. But this bug, which appears to be very widespread, is really getting in the way of that. I also suspect that there are many more undocumented instances of players experiencing this. It's taken about a dozen crashes for me to get round to writing this report. Many players have less technical understanding and may simply abandon the game after a few instances like this.

An unexpected/sudden disconnection of a Bluetooth controller/device is a common occurrence, and something that the game needs to be able to handle without entirely crashing. The issue appears to have existed for players since at least April 2020, perhaps much earlier. Please could some resources be devoted to further looking into this issue, I'm sure myself and many other players will be very grateful.
 
Top