mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
fix: dereference before null check
This commit is contained in:
@@ -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)
|
||||
{
|
||||
if (!fav)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
|
||||
|
||||
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)
|
||||
if (fav != nullptr)
|
||||
{
|
||||
fav->func(pixbuf);
|
||||
}
|
||||
fav->func(pixbuf);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user