Merge "Fix warnings from static analysis tool."

This commit is contained in:
George Chang
2023-04-12 09:21:12 +00:00
committed by Gerrit Code Review

View File

@@ -124,6 +124,9 @@ public final class NdefFormatable extends BasicTagTechnology {
try { try {
int serviceHandle = mTag.getServiceHandle(); int serviceHandle = mTag.getServiceHandle();
INfcTag tagService = mTag.getTagService(); INfcTag tagService = mTag.getTagService();
if (tagService == null) {
throw new IOException();
}
int errorCode = tagService.formatNdef(serviceHandle, MifareClassic.KEY_DEFAULT); int errorCode = tagService.formatNdef(serviceHandle, MifareClassic.KEY_DEFAULT);
switch (errorCode) { switch (errorCode) {
case ErrorCodes.SUCCESS: case ErrorCodes.SUCCESS: