Skip to content

Commit

Permalink
check for none before returning which (#4187)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 authored and simon committed Oct 23, 2024
1 parent 0d16f22 commit 491e4d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions reflex/utils/path_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def get_node_path() -> str | None:
"""
node_path = Path(constants.Node.PATH)
if use_system_node() or not node_path.exists():
return str(which("node"))
system_node_path = which("node")
return str(system_node_path) if system_node_path else None
return str(node_path)


Expand All @@ -197,7 +198,8 @@ def get_npm_path() -> str | None:
"""
npm_path = Path(constants.Node.NPM_PATH)
if use_system_node() or not npm_path.exists():
return str(which("npm"))
system_npm_path = which("npm")
return str(system_npm_path) if system_npm_path else None
return str(npm_path)


Expand Down

0 comments on commit 491e4d5

Please sign in to comment.