main: tighten operations check

This commit is contained in:
Thomas Schoebel-Theuer 2022-06-02 10:50:06 +02:00 committed by Thomas Schoebel-Theuer
parent ffde5c0867
commit e01d5ac272
1 changed files with 8 additions and 0 deletions

View File

@ -1715,9 +1715,17 @@ done:;
static
bool _is_trans_input_fully_working(struct trans_logger_input *trans_input)
{
struct mars_brick *prev_brick;
if (!trans_input ||
!trans_input->connect)
return false;
prev_brick = (void *)trans_input->connect->brick;
if (!prev_brick ||
!prev_brick->power.button ||
!prev_brick->power.led_on)
return false;
return true;
}