Now checks BPath init status before using it, this was crashing the Tracker in #6305.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39810 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2010-12-10 20:06:18 +00:00
parent f7218c2187
commit 7eb2d53b4c
+2 -1
View File
@@ -3382,7 +3382,8 @@ BContainerWindow::AddMimeTypesToMenu(BMenu *menu)
BPath path;
if (TargetModel() != NULL) {
TargetModel()->GetPath(&path);
if (strstr(path.Path(), "/" kQueryTemplates "/") != NULL) {
if (path.InitCheck() == B_OK
&& strstr(path.Path(), "/" kQueryTemplates "/") != NULL) {
// demangle MIME type name
BString name(TargetModel()->Name());
name.ReplaceFirst('_', '/');