Closed mxh-mo closed 11 months ago
"{\"tinyId\":\"144115529973900856\",\"originalAccountModel\":{\"accountIdType\":0,\"authKeyType\":0,\"authKey\":\"-xsDf6nk76jKc8Gogrb54g.M\",\"isVisitor\":false,\"accountId\":\"2873916004\"},\"ticketModel\":{\"a2ExpireTime\":1700119148,\"a2Ticket\":\"3216c2ec48d5b894b423601efd24ca8c694a6b1a57550022f658825f0a401e7d5684807871fd19ca8f1626d2c8038b35bf98d0c87febce6aeb91d846112ae4796e949845a2be6d0c\"},\"uid\":\"4999561028\",\"accountStatus\":0}"
@rakuyoMo i provided json string, could you debug this issue first
Use it! Is it too dangerous ?
@rakuyoMo i provided json string, could you debug this issue first
Okay, I'll troubleshoot this first.
BTW, This isn't the json for #9?
This json displays fine in my demo, have you tried to reproduce your problem using the demo in your project?
The current information is not enough for me to troubleshoot the issue, but I noticed in your screenshot that the self
variable has a value of nil, or you should check the method or timing of how you initialize or use the JSONPreview
instance. Or provide me more information about it. It would be better if you can directly provide a minimized demo that reproduces the problem.
This is not mandatory
I have an assumption:
I guess you are using JSONPreview in combination with a list view (UITableView or UICollectiontView).
If this is the case, then it is possible to have a decorator
of nil
when sliding fast, or in other cases, perhaps in the decorator
's didSet method.
decorator
is assigned -> Cell of JSONPreview instance‘s superview is released -> decorator
is nil in decorator
's didSet method.
@mxh-mo I committed some code on the develop branch, you can try switching to that branch and see if the crash still occurs.
But I'm more concerned about whether the behavior of the JSONPreview object meets your expectations if the crash goes away. I am very concerned about that.
I will close the issue as well as #9 and you can reply under this question if the issue is not resolved.
If the fix causes other issues, you can open a new issue.
Have a nice life.
We fixed code like this:
The highlight(_: judgmentValid: style:)
method will return nil
when the json
is illegal.
Similar processing has been added to the develop branch. It looks like we can release the change.
but is still crash, then we changed like this:
self should be use on main queue, too