AP_CANManager: panic if can manager is used before allocation

This commit is contained in:
Siddharth Purohit 2020-08-19 17:55:37 +05:30 committed by Andrew Tridgell
parent 23d9be3499
commit 8a0d98967f
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ public:
static AP_CANManager* get_singleton()
{
if (_singleton == nullptr) {
AP_HAL::panic("CANManager used before allocation.");
}
return _singleton;
}