0

I have a situation in my code where after logout a bunch of cubits are failing to find the current account.

I'm solving it by going in and wrapping the emit's like so:

if (!isClosed) emit(theState);

however, github copilot suggested the following code instead:

if (state != null) emit(theState);

I think it's just wrong, but often co-pilot is smarter than me.

I'm curious as to what this might mean - checking if the state is not null first.
Is it just wrong?
What might be the logic behind this?

Turkey
  • 346
  • 4
  • 16

0 Answers0