mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added a few more missing checks for null entries in mRemoteDirectories
This commit is contained in:
parent
3beaa974b0
commit
b95fbe34bc
@ -722,6 +722,7 @@ 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;
|
void *p;
|
||||||
convertEntryIndexToPointer(mRemoteDirectories[i]->root(),i+1,p);
|
convertEntryIndexToPointer(mRemoteDirectories[i]->root(),i+1,p);
|
||||||
@ -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…
Reference in New Issue
Block a user