AP_Radio: prevent crash if cc2500 device not found

This commit is contained in:
Andrew Tridgell 2018-01-19 16:07:17 +11:00
parent 9f53ae1ea4
commit 907728e323

View File

@ -155,7 +155,7 @@ public:
bool Reset(void);
bool lock_bus(void) {
return dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER);
return dev && dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER);
}
void unlock_bus(void) {
dev->get_semaphore()->give();