mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 12:58:52 +08:00
containers/List add nullptr check
This commit is contained in:
@@ -68,13 +68,14 @@ public:
|
||||
|
||||
bool remove(T removeNode)
|
||||
{
|
||||
if (removeNode == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// base case
|
||||
if (removeNode == _head) {
|
||||
if (_head->getSibling() != nullptr) {
|
||||
if (_head != nullptr) {
|
||||
_head = _head->getSibling();
|
||||
|
||||
} else {
|
||||
_head = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user