how to handle null object in c