If canonicalLibrary (or canonicalEnclosingElement, for Inheritable subclasses) is null, href should be null.
Source
@override
String get href {
if (canonicalLibrary == null) return null;
var p = _parameter.enclosingElement;
if (p is FunctionElement) {
return '${canonicalLibrary.dirName}/${p.name}.html';
} else {
// TODO: why is this logic here?
var name = Operator.friendlyNames.containsKey(p.name)
? Operator.friendlyNames[p.name]
: p.name;
return '${canonicalLibrary.dirName}/${p.enclosingElement.name}/' +
'${name}.html#${htmlId}';
}
}