X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=macosx%2FChapterTitles.m;h=0ad565119df2e4d8cabe0937a4c4c1c663c7ceb6;hb=07cc0ebf6a7141a76fd9b6e2da6cf510def1ebc7;hp=cc2d50c233e75efc9feea1203783de33336b98ec;hpb=39e4bc5bb03e56aa33ab7c2252a6cbc5dc1db09a;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/macosx/ChapterTitles.m b/macosx/ChapterTitles.m index cc2d50c2..0ad56511 100644 --- a/macosx/ChapterTitles.m +++ b/macosx/ChapterTitles.m @@ -65,12 +65,15 @@ { 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) { @@ -87,18 +90,17 @@ } 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; }