[vlc-commits] macosx: fixed rare crash when saving the full prefs

Felix Paul Kühne git at videolan.org
Wed Jun 1 21:23:53 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jun  1 21:23:40 2011 +0200| [68e5d329206610c72bf20f0facfedbbe107d2523] | committer: Felix Paul Kühne

macosx: fixed rare crash when saving the full prefs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68e5d329206610c72bf20f0facfedbbe107d2523
---

 modules/gui/macosx/prefs_widgets.m |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 085883b..7bfc124 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -1124,11 +1124,14 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
 
 - (char *)stringValue
 {
-    if( [o_combo indexOfSelectedItem] >= 0 )
-        return strdup( p_item->ppsz_list[[o_combo indexOfSelectedItem]] );
-    else
-        return strdup( [[VLCMain sharedInstance]
-                            delocalizeString: [o_combo stringValue]] );
+    if( [o_combo indexOfSelectedItem] >= 0 ) {
+        if( p_item->ppsz_list[[o_combo indexOfSelectedItem]] != NULL )
+            return strdup( p_item->ppsz_list[[o_combo indexOfSelectedItem]] );
+    } else {
+        if( [[VLCMain sharedInstance] delocalizeString: [o_combo stringValue]] != NULL )
+            return strdup( [[VLCMain sharedInstance] delocalizeString: [o_combo stringValue]] );
+    }
+    return NULL;
 }
 
 - (void)resetValues



More information about the vlc-commits mailing list