You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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: