Bug fix in \ncc\Objects > Vault > deleteEntry()
https://git.n64.cc/nosial/ncc/-/issues/27
This commit is contained in:
parent
9716ad8e61
commit
33e373c798
1 changed files with 5 additions and 2 deletions
|
@ -74,15 +74,18 @@
|
||||||
*/
|
*/
|
||||||
public function deleteEntry(string $name): bool
|
public function deleteEntry(string $name): bool
|
||||||
{
|
{
|
||||||
foreach($this->Entries as $entry)
|
// Find the entry
|
||||||
|
foreach($this->Entries as $index => $entry)
|
||||||
{
|
{
|
||||||
if($entry->getName() === $name)
|
if($entry->getName() === $name)
|
||||||
{
|
{
|
||||||
$this->Entries = array_diff($this->Entries, [$entry]);
|
// Remove the entry
|
||||||
|
unset($this->Entries[$index]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Entry not found
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue