Error while accessing empty KV keys
Closed this issue ยท 4 comments
mukhtharcm commented
While accessing non existing kv keys, currently it's throwing an error.
Unhandled Promise Rejection: Error: TypeError: null: type 'JSNull' is not a subtype of type 'FutureOr<String>'
I'm no expert in these, but a better idea would be to make the return type of get
from kvNamespace from Future<String>
to Future<String?>
. Then we can check if the key exists by checking if the value is null.
Ehesp commented
Ah thanks, I'll sort that. Still trying to figure out how to properly test everything ๐
mukhtharcm commented
Thank you for the fast response!
Ehesp commented
Figured out a testing flow now sorted will be able to test everything ๐