Fixed crash of applet when encoding "Arabic (ISO-8859-6)" was previously selected.
authorRoman Moravcik <roman.moravcik@gmail.com>
Tue, 20 Jul 2010 10:02:52 +0000 (12:02 +0200)
committerRoman Moravcik <roman.moravcik@gmail.com>
Tue, 20 Jul 2010 10:02:52 +0000 (12:02 +0200)
applet/cpmpsubtitles.c

index 81a0522..5bf8b1c 100644 (file)
@@ -676,14 +676,15 @@ create_subtitles_encoding_button (GConfClient *gconf_client)
 
        encoding = gconf_get_string (gconf_client, "subtitle_encoding");
        if (encoding) {
-               /* skip current locale */
-               gint index = 1;
+               gint index = 0;
 
                while (index < SUBTITLE_ENCODING_LAST) {
-                       if (strcmp (encodings[index].charset, encoding) == 0) {
-                               hildon_picker_button_set_active (HILDON_PICKER_BUTTON (button),
-                                                                index);
-                               break;
+                       if (encodings[index].charset) {
+                               if (strcmp (encodings[index].charset, encoding) == 0) {
+                                       hildon_picker_button_set_active (HILDON_PICKER_BUTTON (button),
+                                                                        index);
+                                       break;
+                               }
                        }
                        index++;
                }