Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove empty if block and prevent use of pointer after erase
This removes an empty if block that was kept for legacy purposes but no longer serves any functional purpose. Additionally, it addresses the improper use of the container pointer after the iterator it is erased from the openContainers structure, which could lead to undefined behavior and crashes. Changes made: • Removed the empty block if (container && container->getID() == ITEM_BROWSEFIELD) { }, which was no longer needed. • Stored the value of container in a temporary variable before erasing the iterator it from the openContainers map. These changes improve code stability, prevent potential crashes, and make the code cleaner by removing unnecessary logic.
- Loading branch information