mirror of
https://github.com/hwchase17/langchain
synced 2024-11-04 06:00:26 +00:00
core[patch] Do not try to access attribute of None (#16321)
This commit is contained in:
parent
4b7969efc5
commit
226fe645f1
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user