Skip to content

MiFare.CardReader.FindAsync is not async and cannot be awaited #14

@Bobilas

Description

@Bobilas

If you attempt calling SmartCardReader reader = await CardReader.FindAsync() and no card reader is connected, you will get "System.NullReferenceException: Object reference not set to an instance of an object.", because it attempts to await null. It should either return Task.FromResult(null), or be rewritten so it's actually async.

The workaround I had to use is SmartCardReader reader = CardReader.FindAsync()?.Result;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions