Skip to content

Commit d9519b8

Browse files
gkelloggdavidlehn
authored andcommitted
Fix check for term having _prefix.
1 parent fcd3a8f commit d9519b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/compact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ api.compactIri = ({
827827
// If iri could be confused with a compact IRI using a term in this context,
828828
// signal an error
829829
for(const [term, td] of activeCtx.mappings) {
830-
if(td._prefix && iri.startsWith(term + ':')) {
830+
if(td && td._prefix && iri.startsWith(term + ':')) {
831831
throw new JsonLdError(
832832
(`Absolute IRI "${iri}" confused with prefix "${term}".`),
833833
'jsonld.SyntaxError',

0 commit comments

Comments
 (0)