Add check on perception and propulsion being null
This commit is contained in:
parent
ec1da8f81c
commit
4fcbcf80ad
@ -14,8 +14,10 @@ Roboid::Roboid() {
|
|||||||
|
|
||||||
Roboid::Roboid(Perception *perception, Propulsion *propulsion) : Roboid() {
|
Roboid::Roboid(Perception *perception, Propulsion *propulsion) : Roboid() {
|
||||||
this->perception = perception;
|
this->perception = perception;
|
||||||
|
if (perception != nullptr)
|
||||||
perception->roboid = this;
|
perception->roboid = this;
|
||||||
this->propulsion = propulsion;
|
this->propulsion = propulsion;
|
||||||
|
if (propulsion != nullptr)
|
||||||
propulsion->roboid = this;
|
propulsion->roboid = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user