Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-142655

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a
    • Fix Version/s: Minecraft 19w06a
    • Confirmation Status:
      Confirmed

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                boq [Mojang] Bartosz Bok
                Reporter:
                0sk4r Oskar Pester
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: