diff options
| author | Peiyong Lin <lpy@google.com> | 2020-09-28 23:17:37 -0700 |
|---|---|---|
| committer | Peiyong Lin <lpy@google.com> | 2020-09-28 23:17:37 -0700 |
| commit | c5c17e66ba236bcd44240308dfcf4fe0a794ccbd (patch) | |
| tree | fe574fd9fbc332e61c4e7d1c02bf67d374469060 /core/java/android/os/GraphicsEnvironment.java | |
| parent | 64389beb167d2ca6cfa4a619eb80ab297feaa3d5 (diff) | |
[GraphicsEnvironment] Avoid null access.
Currently when debug layer apk is not installed, GraphicsEnvironment
logs the message and proceeds, which results in null pointer access
crash when later trying to access primaryAbi. Avoid null access by an
early return statement.
Bug: N/A
Test: specify not installed debug layer apk and no crash
Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
Diffstat (limited to 'core/java/android/os/GraphicsEnvironment.java')
| -rw-r--r-- | core/java/android/os/GraphicsEnvironment.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java index 52ee04c169c1..54f80c613f0a 100644 --- a/core/java/android/os/GraphicsEnvironment.java +++ b/core/java/android/os/GraphicsEnvironment.java @@ -267,6 +267,7 @@ public class GraphicsEnvironment { } if (appInfo == null) { Log.w(TAG, "Debug layer app '" + packageName + "' not installed"); + return ""; } final String abi = chooseAbi(appInfo); |
