mirror of
https://github.com/transmission/transmission
synced 2025-03-03 18:25:35 +00:00
fix: dereference before null check
This commit is contained in:
parent
ca20b2b895
commit
cd78967815
1 changed files with 6 additions and 4 deletions
|
@ -77,6 +77,11 @@ void favicon_web_done_cb(tr_web::FetchResponse const& response);
|
||||||
|
|
||||||
bool favicon_web_done_idle_cb(std::unique_ptr<favicon_data> fav)
|
bool favicon_web_done_idle_cb(std::unique_ptr<favicon_data> fav)
|
||||||
{
|
{
|
||||||
|
if (!fav)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
|
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
|
||||||
|
|
||||||
if (!fav->contents.empty()) /* we got something... try to make a pixbuf from it */
|
if (!fav->contents.empty()) /* we got something... try to make a pixbuf from it */
|
||||||
|
@ -94,10 +99,7 @@ bool favicon_web_done_idle_cb(std::unique_ptr<favicon_data> fav)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not released into the next web request, means we're done trying (even if `pixbuf` is still invalid)
|
// Not released into the next web request, means we're done trying (even if `pixbuf` is still invalid)
|
||||||
if (fav != nullptr)
|
fav->func(pixbuf);
|
||||||
{
|
|
||||||
fav->func(pixbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue