emotion: no segv when no webcam has been detected.
authorcedric <cedric>
Sun, 13 Nov 2011 21:52:13 +0000 (21:52 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 13 Nov 2011 21:52:13 +0000 (21:52 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@65137 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/emotion_main.c

index 54748f0..d7d6902 100644 (file)
@@ -406,9 +406,12 @@ emotion_webcam_custom_get(const char *device)
    const Emotion_Webcam *ew;
    const Eina_List *l;
 
-   EINA_LIST_FOREACH(_emotion_webcams->webcams, l, ew)
-     if (ew->device && strcmp(device, ew->device) == 0)
-       return ew->custom;
+   if (_emotion_webcams)
+     {
+       EINA_LIST_FOREACH(_emotion_webcams->webcams, l, ew)
+        if (ew->device && strcmp(device, ew->device) == 0)
+          return ew->custom;
+     }
 
    return NULL;
 }