Json exception occured

Discussion and help for Easy Save 3
Post Reply
Uchiha I_T_H_
Posts: 20
Joined: Tue Apr 20, 2021 4:34 am

Json exception occured

Post by Uchiha I_T_H_ »

FormatException: Expected '}', found ']'.

I have validated the json of saved files and its ok but I am getting this error. what is the issue?
It occurred when using autosave feature
Uchiha I_T_H_
Posts: 20
Joined: Tue Apr 20, 2021 4:34 am

Re: Json exception occured

Post by Uchiha I_T_H_ »

Ok, I found the issue. Easy auto save is saving a component which was no longer there that's what causing this.
Although there should be check for this type of case.
Anyways , I will patch easy save code myself for this case.
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Json exception occured

Post by Joel »

Hi there,

As far as we're aware, Unity provides no reliable way of checking for missing Component references at runtime, so this is unfortunately not something we can account for. Unity should usually throw warnings when there are missing Component references however to indicate that it might cause unexpected behaviour.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Uchiha I_T_H_
Posts: 20
Joined: Tue Apr 20, 2021 4:34 am

Re: Json exception occured

Post by Uchiha I_T_H_ »

Although you guys are the experts in this field but I think you can check via reflection.
just stop the compilation if you find the es3 autotype reference is null.
I use this asset quite often and you can borrow its code if you like to-
https://github.com/redbluegames/unity-notnullattribute

If I would be able patch that code in coming days I will share with you guys.
Also, thanks for the support
User avatar
Joel
Moodkie Staff
Posts: 4849
Joined: Wed Nov 07, 2012 10:32 pm

Re: Json exception occured

Post by Joel »

Hi there,

This would only work if you know what type of Component you're expecting to be missing, but very rarely would this be the case.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply