From ce7513da5c949270db645691f18bf787f0503e86 Mon Sep 17 00:00:00 2001 From: tomaszgolebiowski <37900990+tomaszgolebiowski@users.noreply.github.com> Date: Thu, 6 Feb 2025 23:39:48 +0800 Subject: [PATCH] Prevent null reference exception on theme change (#220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Test plan Try changing the VS theme when loading the extension Co-authored-by: Tomasz Gołębiowski --- src/Cody.UI/Controls/WebviewController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Cody.UI/Controls/WebviewController.cs b/src/Cody.UI/Controls/WebviewController.cs index f63cf85..75da303 100644 --- a/src/Cody.UI/Controls/WebviewController.cs +++ b/src/Cody.UI/Controls/WebviewController.cs @@ -153,6 +153,7 @@ public async void OnThemeChanged(object sender, IColorThemeChangedEvent e) { try { + if (_webview == null) return; string updatedScript = e.ThemingScript; if (updatedScript != _colorThemeScript) {