additional nullptr checks
This commit is contained in:
parent
a0e7b45d94
commit
73dcb78a65
@ -1,5 +1,5 @@
|
||||
#include "ObjectManager.h"
|
||||
#include "../serviceinterface/ServiceInterfaceStream.h"
|
||||
#include "../serviceinterface/ServiceInterface.h"
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
#include <iomanip>
|
||||
@ -75,6 +75,8 @@ void ObjectManager::initialize() {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "ObjectManager::initialize: Passed produceObjects "
|
||||
"functions is nullptr!" << std::endl;
|
||||
#else
|
||||
sif::printError("ObjectManager::initialize: Passed produceObjects functions is nullptr!\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
@ -5,15 +5,19 @@
|
||||
SystemObject::SystemObject(object_id_t setObjectId, bool doRegister) :
|
||||
objectId(setObjectId), registered(doRegister) {
|
||||
if (registered) {
|
||||
if(objectManager != nullptr) {
|
||||
objectManager->insert(objectId, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SystemObject::~SystemObject() {
|
||||
if (registered) {
|
||||
if(objectManager != nullptr) {
|
||||
objectManager->remove(objectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object_id_t SystemObject::getObjectId() const {
|
||||
return objectId;
|
||||
|
Loading…
Reference in New Issue
Block a user