Explorar el Código

guard against undefined `values` in ParameterControls

Alexander Rose hace 5 años
padre
commit
6bbee58d39
Se han modificado 1 ficheros con 1 adiciones y 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];