Fix bug 281133 - Add Bookmark fails for page without a title. Test to see if we have a page title before adding to the dict.

This commit is contained in:
smfr%smfr.org 2005-04-02 17:37:15 +00:00
parent ee87507218
commit 6562c84def

View File

@ -1899,16 +1899,15 @@ enum BWCOpenDest {
NSString* hrefString = nil;
[self bookmarkableTitle:&curTitleString URL:&hrefString forWrapper:browserWrapper];
NSMutableDictionary* itemInfo = [NSMutableDictionary dictionaryWithObjectsAndKeys:
curTitleString, kAddBookmarkItemTitleKey,
hrefString, kAddBookmarkItemURLKey,
nil];
NSMutableDictionary* itemInfo = [NSMutableDictionary dictionaryWithObject:hrefString forKey:kAddBookmarkItemURLKey];
if (browserWrapper == mBrowserView)
{
[itemInfo setObject:[NSNumber numberWithBool:YES] forKey:kAddBookmarkItemPrimaryTabKey];
}
// titlel can be nil (e.g. for text files)
if (curTitleString)
[itemInfo setObject:curTitleString forKey:kAddBookmarkItemTitleKey];
if (browserWrapper == mBrowserView)
[itemInfo setObject:[NSNumber numberWithBool:YES] forKey:kAddBookmarkItemPrimaryTabKey];
[itemsArray addObject:itemInfo];
}