Fix possible nil pointer deref in interface check