Skip to content

Commit

Permalink
Break execution when NDEF is not writable (semlette#63)
Browse files Browse the repository at this point in the history
* Break execution when ndef is not writable

* Break writeNDEF when tag isn't writable
  • Loading branch information
timnew authored Jan 20, 2022
1 parent 5cb85cf commit 6daf38e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FlutterNfcKitPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
} else true
}

val switchTechnology = { target: TagTechnology, other: TagTechnology? ->
val switchTechnology = { target: TagTechnology, other: TagTechnology? ->
if (!target.isConnected) {
// close previously connected technology
if (other !== null && other.isConnected) {
Expand Down Expand Up @@ -216,6 +216,7 @@ class FlutterNfcKitPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
val ndef = ndefTechnology!!
if (ndef.isWritable() == false) {
result.error("405", "Tag not writable", null)
return
}
thread {
try {
Expand Down Expand Up @@ -259,6 +260,7 @@ class FlutterNfcKitPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
val ndef = ndefTechnology!!
if (ndef.isWritable() == false) {
result.error("405", "Tag not writable", null)
return
}
thread {
try {
Expand Down

0 comments on commit 6daf38e

Please sign in to comment.