Make sure to not ref a NULL object