smurf: Check for errors before accsssing pointers

Avoids seg faults