-
Notifications
You must be signed in to change notification settings - Fork 46
[Question] Handling nullable value types #1223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @dri-richard , thank you for filling out this ticket! Could you please further explain your use case here by providing some code snippets? |
Hey @dri-richard. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Currently, our customer has modifed the data in the Firebase console to resolve the error so I'm waiting permission to temporarily reintroduce problematic data for testing and to verify the code path. |
Hey @dri-richard. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
What is your question?
We're working with a customer who has a sizeable Firestore database, and we're developing new client software in Unity. Previously they used native SDKs.
The problem is that occasionally a document has a null value for e.g. a boolean field, and DocumentSnapshot.ConvertTo() raises an exception:
System.ArgumentException: Unable to convert null value to System.Boolean at Firebase.Firestore.ValueDeserializer.Deserialize (Firebase.Firestore.DeserializationContext context, Firebase.Firestore.FieldValueProxy value, System.Type targetType)
However, we're also not able to use nullable values, which produce this error:
System.NotSupportedException: Profile.newFlag is Nullable value type, which we do not support now due to a Unity limitation. Try using a reference type instead.
What are my options for handling this situation? Should I create a FirestoreConverter for any document type that I suspect may in future be affected? Or is there something else I could do?
thanks
Firebase Unity SDK Version
11.8.1
Unity editor version
2022.3.31f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
Firestore
Other Firebase Component(s) in use
Authentication, Crashlytics, DynamicLinks, Storage, Remote Config
Additional SDKs you are using
No response
Targeted Platform(s)
Apple Platforms
Unity editor platform
Mac
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
The text was updated successfully, but these errors were encountered: