only delete table if not nullptr
This commit is contained in:
parent
1b8fc2af19
commit
8fe8d810e9
@ -5,7 +5,11 @@
|
|||||||
HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId)
|
HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId)
|
||||||
: objectId(objectId), owner(owner) {}
|
: objectId(objectId), owner(owner) {}
|
||||||
|
|
||||||
HealthHelper::~HealthHelper() { healthTable->removeObject(objectId); }
|
HealthHelper::~HealthHelper() {
|
||||||
|
if (healthTable != nullptr) {
|
||||||
|
healthTable->removeObject(objectId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) {
|
ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) {
|
||||||
switch (message->getCommand()) {
|
switch (message->getCommand()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user