Handle invalid address gracefully

Avoid segfault.