Skip to content

Commit e976a19

Browse files
author
Juanjo Alvarez
committed
Readd fixture that triggers the NPE with a link to the issue
Signed-off-by: Juanjo Alvarez <[email protected]>
1 parent d50188f commit e976a19

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
# NOTE: disabled because it causes a NPE on a call to root.getChildren() with a non
3+
# null root, reported at: https://github.com/BashSupport/BashSupport/issues/643
4+
accumulator() {
5+
# Define a global function named $1
6+
# with a global variable named ${1}_sum.
7+
eval "${1}_sum=\$2"
8+
eval "$1() {
9+
${1}_sum=\$(echo \"(\$${1}_sum) + (\$2)\" | bc)
10+
eval \"\$1=\\\$${1}_sum\" # Provide the current sum.
11+
}"
12+
}
13+
14+
accumulator x 1
15+
x r 5
16+
accumulator y 3
17+
x r 2.3
18+
echo $r
19+
y r -3000
20+
echo $r

0 commit comments

Comments
 (0)