Open elichad opened 3 years ago
I can't reproduce this, can you give me more information?
Uncaught TypeError: Cannot read property 'find' of null
at FileReader.reader.onload (demo.js:319223)
reader.onload @ demo.js:319223
load (async)
window.loadFile @ demo.js:319215
onclick @ (index):35
I dug a bit and it looks like there's an error coming from crystcif-parse on load:
Invalid loop - values must be a multiple of tags
Aaaaand it's a problem with line endings. My copy of CHA.cif got converted to CRLF endings, and crystcif-parse doesn't work with those. I switched to LF and it loads.
Sidenote: the loader should fail loudly if it can't load the file! The rest of the code was trying to work with empty/undefined variables since the loader failed, hence the cryptic original message.
When loading CHA.cif or org.cif from the test files on the demo page:
Relates to this line.
The H2O.xyz file works fine so I assume this is a CIF issue.