diff --git a/src/mol-plugin-state/builder/structure/representation-preset.ts b/src/mol-plugin-state/builder/structure/representation-preset.ts index b3919baf76d1626de243ad5913d427bf1d598761..ca504453310f97c76bafdc2d155b4ef775f5f2a0 100644 --- a/src/mol-plugin-state/builder/structure/representation-preset.ts +++ b/src/mol-plugin-state/builder/structure/representation-preset.ts @@ -55,6 +55,8 @@ export namespace StructureRepresentationPresetProvider { } export function updateFocusRepr<T extends ColorTheme.BuiltIn>(plugin: PluginContext, structure: Structure, themeName: T | undefined, themeParams: ColorTheme.BuiltInParams<T> | undefined) { + if (!themeName && !themeParams) return; + return plugin.state.updateBehavior(StructureFocusRepresentation, p => { const c = createStructureColorThemeParams(plugin, structure, 'ball-and-stick', themeName, themeParams); p.surroundingsParams.colorTheme = c;