Skip to content

Commit

Permalink
core[patch] Do not try to access attribute of None (langchain-ai#16321)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored Jan 23, 2024
1 parent 4b7969e commit 226fe64
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/core/langchain_core/runnables/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ def get_function_nonlocals(func: Callable) -> List[Any]:
if "." in kk and kk.startswith(k):
vv = v
for part in kk.split(".")[1:]:
vv = getattr(vv, part)
if vv is None:
break
else:
vv = getattr(vv, part)
else:
values.append(vv)
values.append(vv)
return values
except (SyntaxError, TypeError, OSError):
Expand Down

0 comments on commit 226fe64

Please sign in to comment.