Commit 68094d57 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov

Fix: `response.data.error` if user create new version of dataset and makes...

Fix: `response.data.error` if user create new version of dataset and makes changes on the first step;
parent 4a7d760f
......@@ -182,8 +182,8 @@ class FilesForm extends React.Component<IFilesFormProps, any> {
const mapStateToProps = (state, ownProps) => {
if (state.form[FILES_FORM]) {
const filesFields = [...ownProps.dataset.repositoryFiles];
const lengthWithEmpty = state.form[FILES_FORM].values.repositoryFiles.length;
const filesFields = [...(ownProps.dataset.repositoryFiles || [])];
const lengthWithEmpty = state.form[FILES_FORM].values.repositoryFiles ? state.form[FILES_FORM].values.repositoryFiles.length : 0;
if (filesFields.length < lengthWithEmpty) {
while (filesFields.length !== lengthWithEmpty) {
filesFields.push(new RepositoryFile());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment