OSDN Git Service

MacGui: Fix issue where selecting the chapter tab can crash the macgui if no valid...
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 22 Jan 2008 16:01:59 +0000 (16:01 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 22 Jan 2008 16:01:59 +0000 (16:01 +0000)
- patch by travistex

git-svn-id: svn://localhost/HandBrake/trunk@1222 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/ChapterTitles.m
macosx/Controller.mm

index 26f7191..deef414 100644 (file)
 {
     int i;
     NSString *chapterString;
+    
+    fTitle = title;
+
+    if (!title)
+        return;
+
     int count = hb_list_count( title->list_chapter );
 
     for( i = 0; i < count; i++ )
@@ -38,7 +44,6 @@
         }
     }
     
-    fTitle = title;
 }
 
 - (int)numberOfRowsInTableView:(NSTableView *)aTableView
index 76a40e6..5b0e2c2 100644 (file)
@@ -1295,6 +1295,10 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                /* We display a message if a valid dvd source was not chosen */
                [fSrcDVD2Field setStringValue: @"No Valid Source Found"];
         SuccessfulScan = NO;
+        
+        // Notify ChapterTitles that there's no title
+        [fChapterTitlesDelegate resetWithTitle:nil];
+        [fChapterTable reloadData];
        }
        else
        {