This might be null, if href doesn't exist.  You could either change the previous selector to `a[data-section][href]`, or preferably, do a syntax check right here (requiring that the contents are a string that looks like a fragment identifier), and die() if it fails the check (doing a `continue` afterwards, to skip it in the case of a forced generation).