Skip to content

Commit

Permalink
fix bug of using trim() for undefined sample.sum_formula for decouple…
Browse files Browse the repository at this point in the history
…d samples in sampleDetails component
  • Loading branch information
adambasha0 committed Sep 13, 2023
1 parent e771b6e commit 8d5f3d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const decoupleCheck = (sample) => {
LoadingActions.stop();
return false;
}
if (sample.decoupled && sample.sum_formula.trim() === '') { sample.sum_formula = 'undefined structure'; }
if (sample.decoupled && sample.sum_formula?.trim() === '') { sample.sum_formula = 'undefined structure'; }
if (!sample.decoupled) { sample.sum_formula = ''; }
return true;
};
Expand Down Expand Up @@ -299,7 +299,7 @@ export default class SampleDetails extends React.Component {
if (!sample.decoupled) {
sample.sum_formula = '';
} else {
if (sample.sum_formula.trim() === '') sample.sum_formula = 'undefined structure';
if (sample.sum_formula?.trim() === '') sample.sum_formula = 'undefined structure';
if (sample.residues && sample.residues[0] && sample.residues[0].custom_info) {
sample.residues[0].custom_info.polymer_type = 'self_defined';
delete sample.residues[0].custom_info.surface_type;
Expand Down

0 comments on commit 8d5f3d9

Please sign in to comment.