ScreenSaver: check function return values for success
This commit is contained in:
parent
a3dc72e69c
commit
6d55c2c490
|
@ -702,8 +702,10 @@ ModulesView::PopulateScreenSaverList()
|
||||||
|
|
||||||
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
|
for (uint32 i = 0; i < sizeof(which) / sizeof(which[0]); i++) {
|
||||||
BPath basePath;
|
BPath basePath;
|
||||||
find_directory(which[i], &basePath);
|
if (find_directory(which[i], &basePath) != B_OK)
|
||||||
basePath.Append("Screen Savers", true);
|
continue;
|
||||||
|
else if (basePath.Append("Screen Savers", true) != B_OK)
|
||||||
|
continue;
|
||||||
|
|
||||||
BDirectory dir(basePath.Path());
|
BDirectory dir(basePath.Path());
|
||||||
BEntry entry;
|
BEntry entry;
|
||||||
|
@ -712,8 +714,9 @@ ModulesView::PopulateScreenSaverList()
|
||||||
if (entry.GetName(name) != B_OK)
|
if (entry.GetName(name) != B_OK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BPath path = basePath;
|
BPath path(basePath);
|
||||||
path.Append(name);
|
if (path.Append(name) != B_OK)
|
||||||
|
continue;
|
||||||
|
|
||||||
ScreenSaverItem* item = new ScreenSaverItem(name, path.Path());
|
ScreenSaverItem* item = new ScreenSaverItem(name, path.Path());
|
||||||
fScreenSaversListView->AddItem(item);
|
fScreenSaversListView->AddItem(item);
|
||||||
|
|
Loading…
Reference in New Issue