Skip to content

Commit e386336

Browse files
committed
Check if nil.usages exists.
Fixes fromRdf with input triple having a nil subject.
1 parent eef1932 commit e386336

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- Use the W3C standard MIME type for N-Quads of "application/n-quads". Accept
55
"application/nquads" for compatibility.
66

7+
### Fixed
8+
- Fix fromRdf with input triple having a nil subject.
9+
710
## 0.5.17 - 2018-01-25
811

912
### Changed

lib/fromRdf.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ api.fromRDF = async (
184184

185185
// iterate backwards through each RDF list
186186
const nil = graphObject[RDF_NIL];
187+
if(!nil.usages) {
188+
continue;
189+
}
187190
for(let usage of nil.usages) {
188191
let node = usage.node;
189192
let property = usage.property;

0 commit comments

Comments
 (0)