[NFC] added null pointer judgment to prevent possible NPE problems caused by external calls.
see the following bug report issues (the issue with isAidSelectable(byte[] aid) has not yet been exposed, but it is recommended to take precautions).
bug: 360030987
link: https://issuetracker.google.com/issues/360030987
there are other similar hidden problems in this Terminal.java (although the probability is low in most cases, it is indeed possible, just like the bug above), and it is also recommended to optimize them.
Change-Id: I91b8673d578ec74e37a50f205483346255e51261
diff --git a/src/com/android/se/Terminal.java b/src/com/android/se/Terminal.java
index a15f34f..e9b0e6c 100644
--- a/src/com/android/se/Terminal.java
+++ b/src/com/android/se/Terminal.java
@@ -748,8 +748,9 @@
return false;
}
return true;
+ } else if (mSEHal == null) {
+ return false;
}
-
LogicalChannelResponse[] responseArray = new LogicalChannelResponse[1];
byte[] status = new byte[1];
try {