Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d7ad873 authored by sai.shwethas's avatar sai.shwethas Committed by Sai Shweta S
Browse files

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
parent dee01562
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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: