Fix warnings from static analysis tool.
1.NULL_RETURNS: a. format() Null pointer check is added before calling Tag object's method. Bug: 275291562 Test: Build ok Change-Id: Idb1462585ad9225e6e026608190a1b4a5de68713
This commit is contained in:
committed by
Sai Shweta S
parent
dee01562d0
commit
0d7ad87362
@@ -124,6 +124,9 @@ public final class NdefFormatable extends BasicTagTechnology {
|
||||
try {
|
||||
int serviceHandle = mTag.getServiceHandle();
|
||||
INfcTag tagService = mTag.getTagService();
|
||||
if (tagService == null) {
|
||||
throw new IOException();
|
||||
}
|
||||
int errorCode = tagService.formatNdef(serviceHandle, MifareClassic.KEY_DEFAULT);
|
||||
switch (errorCode) {
|
||||
case ErrorCodes.SUCCESS:
|
||||
|
||||
Reference in New Issue
Block a user