fix a OSX C compiler warning about null pointer