Skip to content

Commit a74fc79

Browse files
committed
Fixed array access
1 parent efac22f commit a74fc79

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/run-android-instrumentation-tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fi
137137
# ---- Chunk accounting (diagnostics) ---------------------------------------
138138

139139
XML_CHUNKS_TOTAL=0
140-
for x in "${XMLS[@]:-}"; do
140+
for x in "${XMLS[@]}"; do
141141
c="$(count_chunks "$x")"; c="${c//[^0-9]/}"; : "${c:=0}"
142142
XML_CHUNKS_TOTAL=$(( XML_CHUNKS_TOTAL + c ))
143143
done
@@ -161,8 +161,8 @@ fi
161161
: > "$SCREENSHOT_OUT"
162162
SOURCE=""
163163

164-
if [ "${#XMLS[@]:-0}" -gt 0 ] && [ "${XML_CHUNKS_TOTAL:-0}" -gt 0 ]; then
165-
for x in "${XMLS[@]:-}"; do
164+
if [ "${#XMLS[@]}" -gt 0 ] && [ "${XML_CHUNKS_TOTAL:-0}" -gt 0 ]; then
165+
for x in "${XMLS[@]}"; do
166166
c="$(count_chunks "$x")"; c="${c//[^0-9]/}"; : "${c:=0}"
167167
[ "$c" -gt 0 ] || continue
168168
ra_log "Reassembling from XML: $x (chunks=$c)"
@@ -197,7 +197,7 @@ if [ -z "$SOURCE" ]; then
197197
if [ "${LOGCAT_CHUNKS:-0}" -gt 0 ]; then extract_cn1ss_stream "$LOGCAT_FILE"; fi
198198
if [ "${XML_CHUNKS_TOTAL:-0}" -gt 0 ] && [ "${LOGCAT_CHUNKS:-0}" -eq 0 ]; then
199199
# concatenate all XMLs
200-
for x in "${XMLS[@]:-}"; do
200+
for x in "${XMLS[@]}"; do
201201
if [ "$(count_chunks "$x")" -gt 0 ]; then extract_cn1ss_stream "$x"; fi
202202
done
203203
fi
@@ -225,7 +225,7 @@ ra_log "SUCCESS -> screenshot saved (${SOURCE}), size: $(stat -c '%s' "$SCREENSH
225225

226226
# Copy useful artifacts for GH Actions
227227
cp -f "$LOGCAT_FILE" "$ARTIFACTS_DIR/$(basename "$LOGCAT_FILE")" 2>/dev/null || true
228-
for x in "${XMLS[@]:-}"; do
228+
for x in "${XMLS[@]}"; do
229229
cp -f "$x" "$ARTIFACTS_DIR/$(basename "$x")" 2>/dev/null || true
230230
done
231231
[ -n "${TEST_EXEC_LOG:-}" ] && cp -f "$TEST_EXEC_LOG" "$ARTIFACTS_DIR/test-results.log" 2>/dev/null || true

0 commit comments

Comments
 (0)