Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

NPE when parsing due to invalid adaptive icon #106

Open
cdraeger opened this issue Nov 6, 2019 · 0 comments
Open

NPE when parsing due to invalid adaptive icon #106

cdraeger opened this issue Nov 6, 2019 · 0 comments

Comments

@cdraeger
Copy link

cdraeger commented Nov 6, 2019

Happens with the latest version 2.6.9.

I had the following code:
Optional<IconFace> iconFile = apkFile.getAllIcons().stream().filter(IconFace::isFile).findFirst();

This crashed with a NullPointerExceptionwhen checking isFile. Reason: getAllIcons() returns an AdaptiveIcon instance. However, both foreground and background icons in this instance are null. The public methods are apparently just using the foreground icon anyway but do not check for null objects, hence the crash.

In my opinion getAllIcons() should not return an icon instance if it is actually not a valid icon (doing null checks would just be a workaround). I expect the bug at the time of the AdaptiveIcon instanciation: the APK definitely has an icon and is also accepted in the Google Play Store.

Unfortunately I cannot share the APK for to confidentiality reasons, sorry!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant