mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 11:53:34 +08:00
Null pointer checks
This commit is contained in:
@@ -37,10 +37,14 @@ class UAVCAN_EXPORT GlobalDataTypeRegistry : Noncopyable
|
||||
struct EntryInsertionComparator
|
||||
{
|
||||
const DataTypeID id;
|
||||
explicit EntryInsertionComparator(Entry* dtd) : id(dtd->descriptor.getID()) { }
|
||||
explicit EntryInsertionComparator(const Entry* dtd)
|
||||
: id((dtd == NULL) ? DataTypeID() : dtd->descriptor.getID())
|
||||
{
|
||||
assert(dtd != NULL);
|
||||
}
|
||||
bool operator()(const Entry* entry) const
|
||||
{
|
||||
assert(entry);
|
||||
assert(entry != NULL);
|
||||
return entry->descriptor.getID() > id;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user