obstacle null pointer fix