diff --git a/fsw/cfe-core/src/time/cfe_time_api.c b/fsw/cfe-core/src/time/cfe_time_api.c index 96b39ca09..8fecdc9ce 100644 --- a/fsw/cfe-core/src/time/cfe_time_api.c +++ b/fsw/cfe-core/src/time/cfe_time_api.c @@ -697,21 +697,20 @@ int32 CFE_TIME_RegisterSynchCallback(CFE_TIME_SynchCallbackPtr_t CallbackFuncPt if (Status == CFE_SUCCESS) { Status = CFE_ES_AppID_ToIndex(AppId, &AppIndex); - } - if (Status != CFE_SUCCESS) - { - /* Called from an invalid context */ - return Status; - } - if (AppIndex >= (sizeof(CFE_TIME_TaskData.SynchCallback) / sizeof(CFE_TIME_TaskData.SynchCallback[0])) || - CFE_TIME_TaskData.SynchCallback[AppIndex].Ptr != NULL) - { - Status = CFE_TIME_TOO_MANY_SYNCH_CALLBACKS; - } - else - { - CFE_TIME_TaskData.SynchCallback[AppIndex].Ptr = CallbackFuncPtr; + if (Status == CFE_SUCCESS) + { + + if (AppIndex >= (sizeof(CFE_TIME_TaskData.SynchCallback) / sizeof(CFE_TIME_TaskData.SynchCallback[0])) || + CFE_TIME_TaskData.SynchCallback[AppIndex].Ptr != NULL) + { + Status = CFE_TIME_TOO_MANY_SYNCH_CALLBACKS; + } + else + { + CFE_TIME_TaskData.SynchCallback[AppIndex].Ptr = CallbackFuncPtr; + } + } } return Status;