From c995b758c8f544a6b69d5684fdfe91064c690ffb Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 14 Nov 2012 11:18:51 +0700 Subject: [PATCH] fixup! Allow disabling document status in file browser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ‘location’ was nil, we would implicitly create a std::string from that, which is not allowed (and crashes). --- Frameworks/OakFileBrowser/src/OakFileBrowser.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Frameworks/OakFileBrowser/src/OakFileBrowser.mm b/Frameworks/OakFileBrowser/src/OakFileBrowser.mm index 77e24671..1c7b2302 100644 --- a/Frameworks/OakFileBrowser/src/OakFileBrowser.mm +++ b/Frameworks/OakFileBrowser/src/OakFileBrowser.mm @@ -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])