From 3d231072425e8762c2c2ac3773e3845d3eebbaf6 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Tue, 2 Apr 2024 21:37:50 +0200 Subject: [PATCH] fix: fix crash of detect_libcamera without CSI cam (#256) Signed-off-by: Patrick Gehrsitz --- libs/hwhandler.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwhandler.sh b/libs/hwhandler.sh index 515b2b6b..32ad9448 100755 --- a/libs/hwhandler.sh +++ b/libs/hwhandler.sh @@ -62,7 +62,7 @@ detect_libcamera() { local avail if [[ "$(is_raspberry_pi)" = "1" ]] && [[ -x "$(command -v libcamera-hello)" ]]; then - avail="$(libcamera-hello --list-cameras | grep -c "Available")" + avail="$(libcamera-hello --list-cameras | grep -c "Available" || echo "0")" if [[ "${avail}" = "1" ]]; then get_libcamera_path | wc -l else