diff options
author | ritsuka <[email protected]> | 2008-07-23 18:51:31 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2008-07-23 18:51:31 +0000 |
commit | 127de2ab5779a0aabb51b511a5814ccf7c480b70 (patch) | |
tree | 8f334c692b58618f1d49c36d0e49399c920d76e1 /macosx/ChapterTitles.m | |
parent | 2f0bd381d554277f4fe77b915dccd0e6f77a3512 (diff) |
MacGui; Fixed a crash when the chapters tableview is selected and a new source is being opened.
Some whitespace cleaning too.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1574 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/ChapterTitles.m')
-rw-r--r-- | macosx/ChapterTitles.m | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/macosx/ChapterTitles.m b/macosx/ChapterTitles.m index cc2d50c23..e957d3ee2 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'; + } } } } @@ -87,18 +90,21 @@ } 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]; + } + else + { + cellEntry = @"__DATA ERROR__"; + } } } - + return cellEntry; } |