PoseView: Fix assertion in InitDirentIterator
The dynamic_cast was called twice, and the assert was done on the first attempt. Now it just cast once, assert on this and pass it further as before. CID 3122.
This commit is contained in:
@@ -1063,10 +1063,11 @@ BPoseView::InitDirentIterator(const entry_ref *ref)
|
||||
|
||||
ASSERT(!sourceModel.IsQuery());
|
||||
ASSERT(sourceModel.Node());
|
||||
ASSERT(dynamic_cast<BDirectory *>(sourceModel.Node()));
|
||||
|
||||
EntryListBase *result = new CachedDirectoryEntryList(
|
||||
*dynamic_cast<BDirectory *>(sourceModel.Node()));
|
||||
BDirectory *directory = dynamic_cast<BDirectory *>(sourceModel.Node());
|
||||
ASSERT(directory);
|
||||
|
||||
EntryListBase *result = new CachedDirectoryEntryList(*directory);
|
||||
|
||||
if (result->Rewind() != B_OK) {
|
||||
delete result;
|
||||
|
||||
Reference in New Issue
Block a user