OSDN Git Service

LinGui: Internalize all the icons so I don't have to install them in
[handbrake-jp/handbrake-jp-git.git] / macosx / ChapterTitles.m
index cc2d50c..0ad5651 100644 (file)
 {
     if(aTableColumn != nil && [[aTableColumn identifier] intValue] == 2)
     {
-        hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex );
-        
-        if( chapter != NULL )
+        if( fTitle )
         {
-            strncpy( chapter->title, [anObject UTF8String], 1023);
-            chapter->title[1023] = '\0';
+            hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex );
+
+            if( chapter != NULL )
+            {
+                strncpy( chapter->title, [anObject UTF8String], 1023);
+                chapter->title[1023] = '\0';
+            }
         }
     }
 }
@@ -79,7 +82,7 @@
       objectValueForTableColumn:(NSTableColumn *)aTableColumn
       row:(int)rowIndex
 {
-    NSString *cellEntry;
+    NSString *cellEntry =  @"__DATA ERROR__";
 
     if([[aTableColumn identifier] intValue] == 1)
     {
     }
     else
     {
-        hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex );
-        
-        if( chapter != NULL )
+        if( fTitle )
         {
-            cellEntry = [NSString stringWithUTF8String:chapter->title];
-        }
-        else
-        {
-            cellEntry = @"__DATA ERROR__";
+            hb_chapter_t *chapter = hb_list_item( fTitle->list_chapter, rowIndex );
+
+            if( chapter != NULL )
+            {
+                cellEntry = [NSString stringWithUTF8String:chapter->title];
+            }
         }
     }
-    
+
     return cellEntry;
 }