mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-23 00:21:26 +01:00
Add pathInvalidClear
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
6c250de41c
commit
57832351ea
@ -125,7 +125,7 @@ final class TagHandlerImpl implements TagHandler {
|
||||
// Remove entry
|
||||
{
|
||||
Entry<?>[] finalEntries = pathHandlers[length - 1].entries;
|
||||
if (finalEntries.length >= tagIndex) finalEntries[tagIndex] = null;
|
||||
if (finalEntries.length > tagIndex) finalEntries[tagIndex] = null;
|
||||
}
|
||||
// Clear empty parents
|
||||
boolean empty = false;
|
||||
|
@ -152,6 +152,15 @@ public class TagPathTest {
|
||||
assertNull(handler.getTag(tag));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pathInvalidClear() {
|
||||
var handler = TagHandler.newHandler();
|
||||
var tag1 = Tag.Integer("pathInvalidClear1").path("key");
|
||||
var tag2 = Tag.Integer("pathInvalidClear2").path("key");
|
||||
handler.setTag(tag1, 5);
|
||||
handler.setTag(tag2, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void chaining() {
|
||||
var handler = TagHandler.newHandler();
|
||||
|
Loading…
Reference in New Issue
Block a user