fix: fix crash of detect_libcamera without CSI cam (#256)

Signed-off-by: Patrick Gehrsitz <mryel00.github@gmail.com>
This commit is contained in:
Patrick Gehrsitz 2024-04-02 21:37:50 +02:00 committed by GitHub
parent 0d0caeb5b7
commit 3d23107242
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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