fix(serialize): if view wasn't touched, run skipValue on close
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
7c32530ee1
commit
df4781ca9d
@ -135,6 +135,10 @@ public class ReaderItemView<TEx extends Exception> extends SerializeReader.Deleg
|
||||
|
||||
@Override
|
||||
public void close() throws TEx {
|
||||
if (!began) {
|
||||
skipValue();
|
||||
return;
|
||||
}
|
||||
while (depth > 0) {
|
||||
depth = switch (delegate.peek()) {
|
||||
case BEGIN_ARRAY, BEGIN_OBJECT, NULL, BOOLEAN, NUMBER, STRING, NAME -> {
|
||||
|
@ -144,9 +144,13 @@ public class WriterItemView<TEx extends Exception> extends SerializeWriter.Deleg
|
||||
|
||||
@Override
|
||||
public void close() throws TEx {
|
||||
if (!began) {
|
||||
delegate.nullValue();
|
||||
return;
|
||||
}
|
||||
while (depth > 0) {
|
||||
if (stack[--depth]) endArray();
|
||||
else endObject();
|
||||
if (stack[--depth]) delegate.endArray();
|
||||
else delegate.endObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user