結果 : how to avoid dereferencing null pointer