Преглед изворни кода

guard against undefined `values` in ParameterControls

Alexander Rose пре 5 година
родитељ
комит
6bbee58d39
1 измењених фајлова са 1 додато и 1 уклоњено
  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];