Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Commit ee9eda9

Browse files
Martinrussss
authored andcommitted
Change reder_app not to break when a record is missng
The records in the app need not necessarily be consecutive. The sequence can be 2,2 - 2,3 - 3,4
1 parent 0665176 commit ee9eda9

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

emv/command/client.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,15 @@ def render_app(card, df, redact):
111111
as_table(data[Tag.FCI][Tag.FCI_PROP], "FCI Proprietary Data", redact=redact)
112112
)
113113
for i in range(1, 31):
114-
try:
115114
for j in range(1, 16):
116-
rec = card.read_record(j, sfi=i).data
117-
if Tag.RECORD not in rec:
118-
break
119-
click.echo(
120-
as_table(rec[Tag.RECORD], "File: %s,%s" % (i, j), redact=redact)
121-
)
122-
except ErrorResponse:
123-
continue
124-
115+
try:
116+
rec = card.read_record(j, sfi=i).data
117+
except ErrorResponse:
118+
continue
119+
if Tag.RECORD in rec:
120+
click.echo(
121+
as_table(rec[Tag.RECORD], "File: %s,%s" % (i, j), redact=redact)
122+
)
125123

126124
@cli.command(help="Dump card information.")
127125
@click.pass_context

0 commit comments

Comments
 (0)