summaryrefslogtreecommitdiff
path: root/src/PixbufCache.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/PixbufCache.vala')
-rw-r--r--src/PixbufCache.vala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/PixbufCache.vala b/src/PixbufCache.vala
index cee33c6..76fdbd3 100644
--- a/src/PixbufCache.vala
+++ b/src/PixbufCache.vala
@@ -80,7 +80,7 @@ public class PixbufCache : Object {
private Gee.ArrayList<Photo> lru = new Gee.ArrayList<Photo>();
private Gee.HashMap<Photo, FetchJob> in_progress = new Gee.HashMap<Photo, FetchJob>();
- public signal void fetched(Photo photo, owned Gdk.Pixbuf? pixbuf, Error? err);
+ public signal void fetched(Photo photo, Gdk.Pixbuf? pixbuf, Error? err);
public PixbufCache(SourceCollection sources, PhotoType type, Scaling scaling, int max_count,
CacheFilter? filter = null) {
@@ -120,7 +120,11 @@ public class PixbufCache : Object {
}
// This call never blocks. Returns null if the pixbuf is not present.
- public Gdk.Pixbuf? get_ready_pixbuf(Photo photo) {
+ public Gdk.Pixbuf? get_ready_pixbuf(Photo? photo) {
+ if (photo == null) {
+ return null;
+ }
+
return get_cached(photo);
}