mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-19 03:49:29 -04:00
added a few more missing checks for null entries in mRemoteDirectories
This commit is contained in:
parent
3beaa974b0
commit
b95fbe34bc
1 changed files with 14 additions and 11 deletions
|
@ -722,16 +722,17 @@ int p3FileDatabase::RequestDirDetails(void *ref, DirDetails& d, FileSearchFlags
|
||||||
d.children.push_back(stub);
|
d.children.push_back(stub);
|
||||||
}
|
}
|
||||||
else for(uint32_t i=0;i<mRemoteDirectories.size();++i)
|
else for(uint32_t i=0;i<mRemoteDirectories.size();++i)
|
||||||
{
|
if(mRemoteDirectories[i] != NULL)
|
||||||
void *p;
|
{
|
||||||
convertEntryIndexToPointer(mRemoteDirectories[i]->root(),i+1,p);
|
void *p;
|
||||||
|
convertEntryIndexToPointer(mRemoteDirectories[i]->root(),i+1,p);
|
||||||
|
|
||||||
DirStub stub;
|
DirStub stub;
|
||||||
stub.type = DIR_TYPE_PERSON;
|
stub.type = DIR_TYPE_PERSON;
|
||||||
stub.name = mRemoteDirectories[i]->peerId().toStdString();
|
stub.name = mRemoteDirectories[i]->peerId().toStdString();
|
||||||
stub.ref = p;
|
stub.ref = p;
|
||||||
d.children.push_back(stub);
|
d.children.push_back(stub);
|
||||||
}
|
}
|
||||||
|
|
||||||
d.count = d.children.size();
|
d.count = d.children.size();
|
||||||
|
|
||||||
|
@ -757,7 +758,7 @@ int p3FileDatabase::RequestDirDetails(void *ref, DirDetails& d, FileSearchFlags
|
||||||
|
|
||||||
// Case where the index is the top of a single person. Can be us, or a friend.
|
// Case where the index is the top of a single person. Can be us, or a friend.
|
||||||
|
|
||||||
if(!storage->extractData(e,d))
|
if(storage==NULL || !storage->extractData(e,d))
|
||||||
{
|
{
|
||||||
P3FILELISTS_ERROR() << "(EE) request on index " << e << ", for directory ID=" << storage->peerId() << " failed. This should not happen." << std::endl;
|
P3FILELISTS_ERROR() << "(EE) request on index " << e << ", for directory ID=" << storage->peerId() << " failed. This should not happen." << std::endl;
|
||||||
return false ;
|
return false ;
|
||||||
|
@ -823,8 +824,10 @@ uint32_t p3FileDatabase::getType(void *ref) const
|
||||||
|
|
||||||
if(fi == 0)
|
if(fi == 0)
|
||||||
return mLocalSharedDirs->getEntryType(e) ;
|
return mLocalSharedDirs->getEntryType(e) ;
|
||||||
else
|
else if(mRemoteDirectories[fi-1]!=NULL)
|
||||||
return mRemoteDirectories[fi-1]->getEntryType(e) ;
|
return mRemoteDirectories[fi-1]->getEntryType(e) ;
|
||||||
|
else
|
||||||
|
return DIR_TYPE_ROOT ;// some failure case. Should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
void p3FileDatabase::forceDirectoryCheck() // Force re-sweep the directories and see what's changed
|
void p3FileDatabase::forceDirectoryCheck() // Force re-sweep the directories and see what's changed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue