Screenshot: fix crash in file panel

When you edit a folder name in Screenshot's file panel and hit the OK
button, it crashes in the BRefFilter. For MediaConverter, a workaround
was added until Tracker is fixed, see
https://cgit.haiku-os.org/haiku/tree/src/apps/mediaconverter/MediaConverterWindow.cpp#n61

Applying the same workaround here.
This commit is contained in:
Humdinger 2017-10-04 18:26:02 +02:00
parent 6aff37d1c7
commit 2f29f5a241
1 changed files with 6 additions and 1 deletions

View File

@ -99,7 +99,12 @@ public:
virtual bool Filter(const entry_ref* ref, BNode* node,
struct stat_beos* stat, const char* filetype)
{
return node->IsDirectory();
// ToDo: Fix this properly in Tracker
// If you create a folder, then rename it, node is NULL.
// The BeBook says: "Note that the function is never sent an
// abstract entry, so the node, st, and filetype arguments will
// always be valid."
return node == NULL ? false : node->IsDirectory();
}
};