Chromium Code Reviews| Index: base/nix/mime_util_xdg.cc |
| diff --git a/base/nix/mime_util_xdg.cc b/base/nix/mime_util_xdg.cc |
| index 030c30c11f6559361aed3757461a2d89d4268b95..33519bf42f42ffb512ebfa748f6765a511f46d26 100644 |
| --- a/base/nix/mime_util_xdg.cc |
| +++ b/base/nix/mime_util_xdg.cc |
| @@ -588,6 +588,7 @@ namespace base { |
| namespace nix { |
| std::string GetFileMimeType(const FilePath& filepath) { |
| + if (filepath.empty()) return ""; |
|
Randy Smith (Not in Mondays)
2012/08/15 19:30:31
Right, sorry. Why are the changes in this file pa
benjhayden
2012/08/16 18:52:09
Split to http://codereview.chromium.org/10831337/
|
| base::ThreadRestrictions::AssertIOAllowed(); |
| base::AutoLock scoped_lock(g_mime_util_xdg_lock.Get()); |
| return xdg_mime_get_mime_type_from_file_name(filepath.value().c_str()); |
| @@ -625,7 +626,9 @@ FilePath GetMimeIcon(const std::string& mime_type, size_t size) { |
| std::string icon_name; |
| FilePath icon_file; |
| - { |
| + if (mime_type.empty()) { |
| + icon_name = ""; |
| + } else { |
| base::AutoLock scoped_lock(g_mime_util_xdg_lock.Get()); |
| const char *icon = xdg_mime_get_icon(mime_type.c_str()); |
| icon_name = std::string(icon ? icon : ""); |