Protect against no content nodes when checking :contains