Skip to content

Commit

Permalink
Return early and log for unattached NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto authored and joshmh committed Jul 8, 2019
1 parent 84f9809 commit a256962
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/ssuboard/fob-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ function processNfc (event) {
}

function run () {
return nfc.run(deviceConfig.brain.nfcReader)
const nfcReader = deviceConfig.brain.nfcReader
if (!nfcReader) {
console.log('NFC not attached')
return
}
return nfc.run(nfcReader)
.then(u2f.run)
.then(() => actionEmitter.on('nfc', processNfc))
}
Expand Down

0 comments on commit a256962

Please sign in to comment.