I do not know your code but it would be very easy either to save the output of Init() in a variable and put the FinishTask() part in an if-statement or have your pointers initialized to 0 (as you always should do) and check for that in your FinishTask().