Some websites could have the tag that satisfies a certain parser, but still miss the actual value of it. These values are null. However, the value getter in lib/src/parser/util.dart (link here), does not check for this, but converts any value to String. Since toString has the ability to even convert null into String ("null"), the job is considered done, and no other parser will be able to attempt actually getting a proper value.
Solution
Before converting value to String, check if value is null.
Context
Some websites could have the tag that satisfies a certain parser, but still miss the actual value of it. These values are
null
. However, the value getter inlib/src/parser/util.dart
(link here), does not check for this, but converts any value toString
. SincetoString
has the ability to even convertnull
intoString
("null"
), the job is considered done, and no other parser will be able to attempt actually getting a proper value.Solution
Before converting value to
String
, check if value is null.Example
imageUrl
will be"null"
(extracted fromog:image
), and will omit theHtmlMetaParser
result, which will have found the correct URL.