Search Issue Tracker

Active

Votes

19

Found in

2017.4

2018.4

2019.2

2019.2.10f1

2019.3

2020.1

2020.2.0a15

Issue ID

1201453

Regression

No

"Unexpected node type." Error is thrown and no Exception is caught when using JsonUtility.FromJsonOverwrite function

Serialization

-

How to reproduce:
1. Open the attached project's Scene labeled "Test"
2. Enter the Play Mode
3. Observe the Console Window

Expected result: An Exception is thrown related to the "Unexpected node type." Error warning about the wrong format
Actual result: "Unexpected node type." Error is thrown but no Exception is caught

Reproducible with: 2017.4.35f1, 2018.4.13f1, 2019.2.15f1, 2019.3.0f1, 2020.1.0a15, 2020.2.0a15.

Note: Old format JSON is used

Comments (4)

  1. 9ee2ba829e41960243caa096b210a3de?d=mm

    floky

    Jun 02, 2020 09:21

    Extra details: the issue ONLY happens if the target object where the json is deserialized has a field of array type and the json contains that field with a non-array type.

    If it's the other way around and the target object contains a non-array type field and that field in the json has a different type (numeric, array, etc) it will not crash and will be silently ignored.

  2. A9b4a5866ac34b451fd59cefc3f0f912?d=mm

    cristiscripcaru

    Jun 01, 2020 09:32

    I have the same problem. When can you fix it?

  3. 6c0bd69ca686e346c3b4d3b2ee9f849b?d=mm

    FanStudioUK

    May 29, 2020 07:16

    Same here!
    You only need to throw an exception...

    Come on guys, it's an easy fix :)

  4. 9ee2ba829e41960243caa096b210a3de?d=mm

    floky

    May 28, 2020 10:06

    Same problem.
    Still happens on Unity 2019.3.14f1.
    No catch-able exception is thrown.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.