From 82ad2c58165da9429112285005aea0a88c8dd358 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 18 Sep 2019 22:47:48 -0400 Subject: [PATCH] Fix invalid exception filter resulting to a crash at startup (#4) --- .../Internal/WasmPlatformEnlightenmentProvider.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs index b7da473..e44f87a 100644 --- a/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs +++ b/src/System.Reactive.Wasm/Internal/WasmPlatformEnlightenmentProvider.cs @@ -30,8 +30,10 @@ public class WasmPlatformEnlightenmentProvider : CurrentPlatformEnlightenmentPro new Thread(() => { }).Start(); return false; } - catch (NotSupportedException) + catch (Exception) { + // Usually a TypeInitializationException, however be safe by considering any platform + // that does not support threading as "Wasm". return true; } }, LazyThreadSafetyMode.PublicationOnly);