Coder Social home page Coder Social logo

NPE about leonids HOT 5 OPEN

ryust avatar ryust commented on August 22, 2024
NPE

from leonids.

Comments (5)

plattysoft avatar plattysoft commented on August 22, 2024

It is watched, but so far there has been no need to maintain it. It seems that every crash report on something like that was a misuse coming for a misunderstanding of how it should be used (and I do agree that it is lacking detailed documentation)

Fell free to fix it and submit a PR.

from leonids.

ryust avatar ryust commented on August 22, 2024

So an NPE within the library's internal code is considered a misuse? How can that be? What is the misuse in the above stacktrace?

from leonids.

plattysoft avatar plattysoft commented on August 22, 2024

Maybe I did not express myself correctly.

As far as I know, all the logged issues on github are linked to wrong usage of the library.

I can not tell what you are doing from a stacktrace, without steps to replicate I can't really find or solve the issue.

You can get plenty of NPE on Android and that is not an issue of the framework (i.e. calling getActivity on a detached fragment)

If you give me steps to replicate, I can look into it, just with a stack trace there's not much I can do.

And finally, as I said, I am happy to accept contributions, so if you want to dig into it and submit a PR with a fix I'll be happy to merge it in.

from leonids.

ryust avatar ryust commented on August 22, 2024

As I indicated, the NPE is random and rare... similar to previous reports. The problem was already documented in issue #43 with a user supplied fix. Since the stacktrace (supplied by Crashlytics) doesn't go deep enough to highlight where in my code it starts, I cannot give a reliable example. The app just has a couple simple onetime particle emits... and the same code works most of the time except for a rare NPE.

Maybe at a minimum wrap the onUpdate in a try/catch to more gracefully handle the NPE regardless of the cause?

from leonids.

plattysoft avatar plattysoft commented on August 22, 2024

Feel free to do a patch, try it and it resolved the problem we can integrate it.
As you can see in the code

The particle system weak reference is only accessed if it is not null, even more, the fact that the previous line executes means that the reference is not null.

Can the reference be turned null between those 2 lines? I can't see how, but as I said, feel free to wrap it on a try/catch and see if that solves the problem. I am reluctant to add something like that to a release just for you to try it out without being sure what is causing it. It may as well surface somewhere else.

from leonids.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.