Fix remote server crash with JSON files (#38678)

Closes #38594

Release Notes:

- N/A
This commit is contained in:
Julia Ryan
2025-09-22 22:30:27 +00:00
committed by GitHub
parent e9fbcf5abf
commit 5e502a32fb
2 changed files with 15 additions and 6 deletions
+5
View File
@@ -73,6 +73,11 @@ impl ThemeRegistry {
cx.default_global::<GlobalThemeRegistry>().0.clone()
}
/// Returns the global [`ThemeRegistry`] if it exists.
pub fn try_global(cx: &mut App) -> Option<Arc<Self>> {
cx.try_global::<GlobalThemeRegistry>().map(|t| t.0.clone())
}
/// Sets the global [`ThemeRegistry`].
pub(crate) fn set_global(assets: Box<dyn AssetSource>, cx: &mut App) {
cx.set_global(GlobalThemeRegistry(Arc::new(ThemeRegistry::new(assets))));