Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException. #12

Open
Aunali321 opened this issue Aug 19, 2022 · 6 comments
Open

NullPointerException. #12

Aunali321 opened this issue Aug 19, 2022 · 6 comments

Comments

@Aunali321
Copy link

if (s.data.length() > 0x7FFF) {

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at pxb.android.StringItems.prepare(StringItems.java:90)
at pxb.android.axml.AxmlWriter.prepare(AxmlWriter.java:344)
at pxb.android.axml.AxmlWriter.toByteArray(AxmlWriter.java:356)

StevenArzt added a commit that referenced this issue Aug 29, 2022
@StevenArzt
Copy link
Member

Should be fixed now. I don't have an app to test with, so please give the updated code a try and close the issue if the problem has been resolved.

@Aunali321
Copy link
Author

@StevenArzt whats the maven for develop branch?

@Vendicated
Copy link

I haven't tested it, but it is likely still broken. Just a few lines lower you access it again without a null check

String stringData = item.data;

@StevenArzt
Copy link
Member

I don't see the problem. My assumption was that item.data is null, not item itself. That's also what my first check is about. If the variable stringData holds null, that should be fine.

@rushiiMachine
Copy link

rushiiMachine commented Sep 27, 2022

int length = stringData.length();
byte[] data = stringData.getBytes("UTF-8");

Here is it again being referenced and causing an NPE

StevenArzt added a commit that referenced this issue Sep 27, 2022
@StevenArzt
Copy link
Member

OK, I got it. Fix has been committed.

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

No branches or pull requests

4 participants