Convert SIGSEGV with NULL pointer to exception