marcglasberg / async_redux

Flutter Package: A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.
Other
234 stars 40 forks source link

Null check operator used on a null value #106

Closed kuhnroyal closed 3 years ago

kuhnroyal commented 3 years ago

I am using WaitAction.remove and it seems the key/ref doesn't exist. That the key does not exist is of course my fault, but there should ne be a force cast in the Wait.

Set<Object?> refs = newFlags[flag]!;
marcglasberg commented 3 years ago

This bang was added automatically by the migrate tool.

What do you think I should be doing here? Just ignore it when the key does not exist?

Set<Object?> refs = newFlags[flag] ?? {};

Throw an error?

Set<Object?> refs = newFlags[flag] ?? {};

I guess first option, right?

kuhnroyal commented 3 years ago

Yea, I would opt for not doing anything. This is how it was until NNBD.

marcglasberg commented 3 years ago

Fixed in version [11.0.0].