Add NULL pointer check to remove_event. #545

Added the NULL pointer check and return immediately if the pointer is NULL.
This commit is contained in:
Alex Lin 2018-01-18 13:23:38 -06:00
parent 36a91abbc3
commit d4ffa4002b

View File

@ -178,6 +178,10 @@ int Trick::EventManager::remove_event(Trick::Event * in_event) {
unsigned int ii , jj ;
if ( ! in_event ) {
return 0 ;
}
if ( in_event->get_before_after() == Trick::EVENT_NOTARGET ) {
/* If the event is cyclic, remove the event from the event processor on the event's thread */
event_processors[in_event->get_thread()]->remove_event(in_event) ;