Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

fix: NSNull treatment #61

Merged
merged 7 commits into from
Nov 29, 2022
Merged

fix: NSNull treatment #61

merged 7 commits into from
Nov 29, 2022

Conversation

Tiagoperes
Copy link
Contributor

@Tiagoperes Tiagoperes commented Nov 29, 2022

Problem solved

When running Nimbus Core on iOS, every property in a Map or Array that was null on Kotlin will be NSNull on Swift. For this reason, we must check for NSNull in some situations instead of just checking for null.

In most of the scenarios where we need to get a value from the property map we also use the class AnyServerDrivenData. To fix the issue, I made AnyServerDrivenData aware of NSNull, making it treat NSNull just like null.

New usages for AnyServerDrivenData

The operations were not using AnyServerDrivenData and where it made sense I replaced the direct accesses with it. Where it didn't make sense, I made sure NSNull was being accounted for.

I also replaced valueOf in the component forEach.

Also fixed

  • It was possible to get IndexOutOfBounds in many of the operations if the arguments were passed wrong. I fixed it with a proper error message.
  • This problem was observed when we attempted to use navigation params. Although it ended up not being the actual problem, I created a simple test to validate this feature.

@hernandazevedozup hernandazevedozup merged commit 62231af into main Nov 29, 2022
@hernandazevedozup hernandazevedozup deleted the fix/navigation-state branch November 29, 2022 19:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants