Skip to content

Commit 1463cab

Browse files
committed
Check if nil.usages exists.
Fixes fromRdf with input triple having a nil subject.
1 parent 533e8d8 commit 1463cab

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
@@ -1,5 +1,8 @@
11
# jsonld ChangeLog
22

3+
### Fixed
4+
- Fix fromRdf with input triple having a nil subject.
5+
36
## 0.5.17 - 2018-01-25
47

58
### 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)