Mojira Archive
MC-142655

Client crashes when opening resolved book on lectern containing malformed text components

The bug

When opening a resolved book containing malformed text components, e.g. value of text not being a string, on a lectern, the game crashes.

Description: Rendering screen

java.lang.ClassCastException: com.google.gson.JsonPrimitive cannot be cast to com.google.gson.JsonObject
	at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:191)
	at jb$a.a(SourceFile:239)
	at jb$a.deserialize(SourceFile:174)
	at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
	at yu.a(SourceFile:497)
	at yu.a(SourceFile:522)
	at jb$a.a(SourceFile:392)
	at cvm$c.a(SourceFile:103)
	at cvm$a.b(SourceFile:46)
	at cvm.a(SourceFile:284)
	at dfb.a(SourceFile:800)
	at cqe.d(SourceFile:931)
	at cqe.b(SourceFile:407)
	at net.minecraft.client.main.Main.main(SourceFile:154)

How to reproduce

  1. Place a lectern with a malformed book
    /setblock ~ ~ ~ lectern[has_book=true]{Book:{id:written_book,Count:1b,tag:{title:title,author:author,pages:["{\"text\":{}}"],resolved:1b}}}
    
  2. Open the book on the lectern
    The client crashes

Fixed

Oskar Pester

[Mojang] Bartosz Bok

2019-01-18, 05:10 PM

2019-05-30, 02:59 PM

2019-02-06, 04:34 PM

1

2

Confirmed

lectern, text-component

Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a

Minecraft 19w06a