How to show an error message for this crash: "Multiple sync agents attempted to join the same session"

terminating due to uncaught exception of type realm::MultipleSyncAgents: Multiple sync agents attempted to join the same session

On macOS, (and surely other OSs) a user can open an application more than once in some situations. It’s understandable that Realm doesn’t work when this happens, but how can I catch this on launch so I can display an error message instead of it hard crashing?

This error is occurring after the Realm is open and subscriptions set.

Thank you,
-Jon