mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-07 05:52:15 +00:00
core[patch] Do not try to access attribute of None (#16321)
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user