Skip to content

Commit

Permalink
handle none heredoc
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Dec 30, 2024
1 parent b0d5324 commit 86aed3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openhands/runtime/utils/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ def escape_bash_special_chars(command: str) -> str:

def visit_node(node):
nonlocal last_pos
if node.kind == 'redirect' and hasattr(node, 'heredoc'):
if (
node.kind == 'redirect'
and hasattr(node, 'heredoc')
and node.heredoc is not None
):
# We're entering a heredoc - preserve everything as-is until we see EOF
# Store the heredoc end marker (usually 'EOF' but could be different)
between = command[last_pos : node.pos[0]]
Expand Down

0 comments on commit 86aed3e

Please sign in to comment.