fixup! Allow disabling document status in file browser

If ‘location’ was nil, we would implicitly create a std::string from that, which is not allowed (and crashes).
This commit is contained in:
Allan Odgaard
2012-11-14 11:18:51 +07:00
parent f9705ffa70
commit c995b758c8

View File

@@ -203,7 +203,7 @@ static bool is_binary (std::string const& path)
- (void)setOpenURLs:(NSArray*)newOpenURLs
{
if(!settings_for_path(NULL_STR, "", [self.location UTF8String]).get(kSettingsFileBrowserDocumentStatusKey, true))
if(!settings_for_path(NULL_STR, "", to_s(self.location)).get(kSettingsFileBrowserDocumentStatusKey, true))
return;
if([outlineViewDelegate.openURLs isEqualToArray:newOpenURLs])
@@ -220,7 +220,7 @@ static bool is_binary (std::string const& path)
- (void)setModifiedURLs:(NSArray*)newModifiedURLs
{
if(!settings_for_path(NULL_STR, "", [self.location UTF8String]).get(kSettingsFileBrowserDocumentStatusKey, true))
if(!settings_for_path(NULL_STR, "", to_s(self.location)).get(kSettingsFileBrowserDocumentStatusKey, true))
return;
if([outlineViewDelegate.modifiedURLs isEqualToArray:newModifiedURLs])