Fix package removal with skipped directories
Volume::_RemovePackageContentRootNode(): Check whether a directory corresponding to the package directory does actually exist. This might not be the case when the package directory has been skipped due to clashing with a shine-through directory. Would crash in this case.
This commit is contained in:
@@ -1182,11 +1182,13 @@ Volume::_RemovePackageContentRootNode(Package* package,
|
|||||||
if (PackageDirectory* packageDirectory
|
if (PackageDirectory* packageDirectory
|
||||||
= dynamic_cast<PackageDirectory*>(packageNode)) {
|
= dynamic_cast<PackageDirectory*>(packageNode)) {
|
||||||
if (packageDirectory->FirstChild() != NULL) {
|
if (packageDirectory->FirstChild() != NULL) {
|
||||||
directory = dynamic_cast<Directory*>(
|
if (Directory* childDirectory = dynamic_cast<Directory*>(
|
||||||
directory->FindChild(packageNode->Name()));
|
directory->FindChild(packageNode->Name()))) {
|
||||||
packageNode = packageDirectory->FirstChild();
|
directory = childDirectory;
|
||||||
directory->WriteLock();
|
packageNode = packageDirectory->FirstChild();
|
||||||
continue;
|
directory->WriteLock();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user