Explorar o código

guard against undefined `values` in ParameterControls

Alexander Rose %!s(int64=5) %!d(string=hai) anos
pai
achega
6bbee58d39
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/mol-plugin/ui/controls/parameters.tsx

+ 1 - 1
src/mol-plugin/ui/controls/parameters.tsx

@@ -34,7 +34,7 @@ export class ParameterControls<P extends PD.Params> extends React.PureComponent<
         const params = this.props.params;
         const values = this.props.values;
         const keys = Object.keys(params);
-        if (keys.length === 0) return null;
+        if (keys.length === 0 || values === undefined) return null;
         return <>
             {keys.map(key => {
                 const param = params[key];