[AT-SPI] Guard added for potential null pointer dereference