From 8e12b9ca76bed74bc4cab5a5a363bdc81101ae11 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Mon, 15 Nov 2021 14:10:08 +0100 Subject: [PATCH] boardd: fix segfault when SIGINT with no pandas (#22914) * boardd: fix segfault when SIGINT with no pandas * remove if block Co-authored-by: Robbe Derks --- selfdrive/boardd/boardd.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index c6f2cf8ed3..12470c9448 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -669,6 +669,11 @@ int main(int argc, char* argv[]) { } } + if (pandas.size() == 0) { + // do_exit was set while not connected to a panda + return 0; + } + peripheral_panda = pandas[0]; LOGW("connected to board");