Skip to content

Commit

Permalink
Fixes 'Nonetype' not iterable for ObsidianLoader (langchain-ai#12751)
Browse files Browse the repository at this point in the history
Implements langchain-ai#12726 from @Di3mex
  • Loading branch information
efriis authored and xieqihui committed Nov 21, 2023
1 parent 726730e commit 799934d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/langchain/langchain/document_loaders/obsidian.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def load(self) -> List[Document]:
}

if tags or front_matter.get("tags"):
metadata["tags"] = ",".join(tags | set(front_matter.get("tags", [])))
metadata["tags"] = ",".join(
tags | set(front_matter.get("tags", []) or [])
)

docs.append(Document(page_content=text, metadata=metadata))

Expand Down

0 comments on commit 799934d

Please sign in to comment.