There was an error while loading. Please reload this page.
1 parent a8ba97a commit 892e813Copy full SHA for 892e813
1 file changed
src/data/molecules/MoleculeManager.ts
@@ -4,6 +4,7 @@ import { Molecule } from 'openchemlib';
4
import type { StateMolecule, StateMoleculeExtended } from './Molecule.js';
5
import { initMolecule } from './Molecule.js';
6
7
+//TODO: Move molecule initialization to nmrium-core and log an error if the molecule cannot be parsed.
8
export function fromJSON(
9
mols: StateMolecule[],
10
reservedMolecules: StateMolecule[] = [],
@@ -13,6 +14,13 @@ export function fromJSON(
13
14
const molecules: StateMoleculeExtended[] = [];
15
for (const mol of mols) {
16
const molecule = Molecule.fromMolfile(mol.molfile);
17
+
18
+ const atomCount = molecule.getAllAtoms();
19
20
+ if (atomCount === 0) {
21
+ continue;
22
+ }
23
24
molecules.push(
25
initMolecule({
26
molfile: molecule.toMolfileV3(),
0 commit comments