* edje: add some error detection.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 9 Aug 2010 18:22:48 +0000 (18:22 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 9 Aug 2010 18:22:48 +0000 (18:22 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@50939 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_out.c

index ccd322f..82cd111 100644 (file)
@@ -1004,6 +1004,13 @@ data_write(void)
    int font_num = 0;
    int collection_num = 0;
 
+   if (!edje_file)
+     {
+       ERR("%s: Error. No data to put in \"%s\"",
+           progname, file_out);
+       exit(-1);
+     }
+
    ef = eet_open(file_out, EET_FILE_MODE_WRITE);
    if (!ef)
      {
@@ -1017,6 +1024,12 @@ data_write(void)
    new_edje_file = _edje_file_convert(ef, edje_file);
    _edje_file_set(new_edje_file);
 
+   if (!new_edje_file)
+     {
+       ERR("%s: Error convertion failed for \"%s\"", progname, file_out);
+       exit(-1);
+     }
+
    /* convert old structure to new one */
    it = eina_hash_iterator_data_new(new_edje_file->collection);