Null check on isVoidVoid()

In case the current `type` was null (is sometimes the case 
when return type hints are not provided in the code but are 
left for type inference to figure out)