Fix either type adapter not consuming peeked null

This commit is contained in:
DBotThePony 2024-03-16 23:11:34 +07:00
parent 8dd176ff87
commit 0340381357
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ kotlin.code.style=official
specifyKotlinAsDependency=false specifyKotlinAsDependency=false
projectGroup=ru.dbotthepony.kommons projectGroup=ru.dbotthepony.kommons
projectVersion=2.9.19 projectVersion=2.9.20
guavaDepVersion=33.0.0 guavaDepVersion=33.0.0
gsonDepVersion=2.8.9 gsonDepVersion=2.8.9

View File

@ -32,7 +32,7 @@ object EitherTypeAdapter : TypeAdapterFactory {
} }
override fun read(`in`: JsonReader): Either<Any, Any>? { override fun read(`in`: JsonReader): Either<Any, Any>? {
if (`in`.peek() == JsonToken.NULL) if (`in`.consumeNull())
return null return null
val elem = elemAdapter.read(`in`) val elem = elemAdapter.read(`in`)