Skip to content

Commit 9607ee4

Browse files
committed
pipeline: Fixed a potential name getting error
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent 3b811a5 commit 9607ee4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

features/pipeline/data/bin/pipeline-sh-functions

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ pipe_name()
5555

5656
IFS="," read -r -a arr <<<"$PIPELINE"
5757

58-
[ "$1" -lt "${#arr[@]}" ] ||
58+
if [ "$1" -ge "${#arr[@]}" ]; then
59+
eval "name=\"\""
5960
return 0
61+
fi
6062

6163
local n="$1"
6264

@@ -72,8 +74,10 @@ pipe_callnum()
7274

7375
IFS="," read -r -a arr <<<"$PIPELINE"
7476

75-
[ "$1" -lt "${#arr[@]}" ] ||
77+
if [ "$1" -ge "${#arr[@]}" ]; then
78+
eval "callnum=\"\""
7679
return 0
80+
fi
7781

7882
local n="$1"
7983

features/pipeline/data/lib/uevent/handlers/pipeline/500-pipeline

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ handler_step()
3434
pipe_name "$pipenum"
3535
pipe_callnum "$pipenum"
3636

37+
if [ -z "${name-}" ] || [ -z "${callnum-}" ]; then
38+
message "step #$pipenum: unable to get name. stopping..."
39+
return 0
40+
fi
41+
3742
exe="$handlerdir/$name"
3843

3944
if [ ! -x "$exe" ]; then

0 commit comments

Comments
 (0)