Skip to content

Commit d22eebe

Browse files
committed
[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: b/175699044 Test: specify not installed debug layer apk and no crash Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff Merged-In: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff (cherry picked from commit c5c17e66ba236bcd44240308dfcf4fe0a794ccbd)
1 parent 11ed014 commit d22eebe

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

core/java/android/os/GraphicsEnvironment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ private static String getDebugLayerAppPaths(IPackageManager pm, String packageNa
248248
}
249249
if (appInfo == null) {
250250
Log.w(TAG, "Debug layer app '" + packageName + "' not installed");
251+
return "";
251252
}
252253

253254
final String abi = chooseAbi(appInfo);

0 commit comments

Comments
 (0)