Skip to content

Commit 66e5378

Browse files
fix(core): fix data[key] edge case such as an empty string
1 parent f2dab56 commit 66e5378

File tree

1 file changed

+1
-1
lines changed
  • libs/core/langchain_core/utils

1 file changed

+1
-1
lines changed

libs/core/langchain_core/utils/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def get_from_dict_or_env(
4848
if value := data.get(k):
4949
return value
5050

51-
if isinstance(key, str) and key in data and data[key]:
51+
if isinstance(key, str) and key in data and data[key] is not None:
5252
return data[key]
5353

5454
key_for_err = key[0] if isinstance(key, (list, tuple)) else key

0 commit comments

Comments
 (0)