antoniogarrote / rdfstore-js

JS RDF store with SPARQL support
MIT License
564 stars 109 forks source link

Error in btree.js #153

Closed MadsHolten closed 6 years ago

MadsHolten commented 6 years ago

Recently I have started to get the following errors:

rdfstore\src\btree.js:324
                    if(that.comparator(key, node.keys[idx].key)===1) {
                                                          ^
TypeError: Cannot read property 'key' of null
rdfstore\src\btree.js:334
                    idx = node.numberActives -1;
                              ^
TypeError: Cannot read property 'numberActives' of null

I have no idea what leads to this error, and I can't seem to find a pattern to when it occurs.

fkleedorfer commented 6 years ago

I fixed that in our copy. Will check.

fkleedorfer commented 6 years ago

If you want a quick fix, here it is https://github.com/researchstudio-sat/webofneeds/commit/c1ad9240b53bb4ba971ef42e11870280f38758cc#diff-d2647e6139e3a0a971420e20014de71d

MadsHolten commented 6 years ago

Thanks! I will try that. Maybe make a pull request on it?

fkleedorfer commented 6 years ago

Oh and there already is a PR fixing it https://github.com/antoniogarrote/rdfstore-js/pull/110/files

MadsHolten commented 6 years ago

Doesn't seem to solve the problem for me :-/

MadsHolten commented 6 years ago

So I think I solved the problem. I was trying to shoot multiple files at the store.load() method at the same time, and it didn't like that. My new strategy is to first concatenate the file content and then load it in store.