sur950 / any_link_preview

A flutter Plugin/Package to show the preview of any web link that starts with HTTP/HTTPS. Mostly useful for application that had chat.
MIT License
70 stars 70 forks source link

Don't convert null value into 'null' string. #64

Closed keiwanmosaddegh closed 5 months ago

keiwanmosaddegh commented 9 months ago

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 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.

Example

MattyBoy4444 commented 7 months ago

Any chance this will make it in soon?

sur950 commented 5 months ago

Thanks for the PR @keiwanmosaddegh

I got a little bandwidth now, Will try to close whatever I can and include this PR as well in my coming version. CC @MattyBoy4444