[f-spot/rubenv-gsoc-2009: 30/86] Fix NullPointerException due the extension method.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot/rubenv-gsoc-2009: 30/86] Fix NullPointerException due the extension method.
- Date: Sun, 23 May 2010 12:34:28 +0000 (UTC)
commit 495d8fef968c801d8f19e8fd7cfde52f5a8bbb48
Author: Ruben Vermeersch <ruben savanne be>
Date: Wed Jul 29 13:31:28 2009 +0200
Fix NullPointerException due the extension method.
The old method returned null when a null argument was passed.
src/Widgets/Filmstrip.cs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/Widgets/Filmstrip.cs b/src/Widgets/Filmstrip.cs
index 9c713bb..b2cbe00 100644
--- a/src/Widgets/Filmstrip.cs
+++ b/src/Widgets/Filmstrip.cs
@@ -611,10 +611,11 @@ namespace FSpot.Widgets
protected virtual Pixbuf GetPixbuf (int i, bool highlighted)
{
- Pixbuf current;
+ Pixbuf current = null;
Uri uri = (selection.Collection [i]).DefaultVersion.Uri;
try {
- current = thumb_cache.Get (uri).ShallowCopy ();
+ if (thumb_cache.Get (uri) != null)
+ current = thumb_cache.Get (uri).ShallowCopy ();
} catch (IndexOutOfRangeException) {
current = null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]