always close the sink

This commit is contained in:
Adam Velebil 2024-03-26 10:30:16 +01:00
parent 6fc18f8fdd
commit ea7ae8acc2
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -240,8 +240,6 @@ class _FidoFingerprintsNotifier extends FidoFingerprintsNotifier {
throw RpcError(errorStatus, 'Platform error: $errorStatus', {});
}
}
await controller.sink.close();
} on PlatformException catch (pe) {
_log.debug('Received platform exception: \'$pe\'');
final decoded = pe.decode();
@ -249,6 +247,8 @@ class _FidoFingerprintsNotifier extends FidoFingerprintsNotifier {
} catch (e) {
_log.debug('Received error: \'$e\'');
controller.sink.addError(e);
} finally {
await controller.sink.close();
}
};