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

Potential NPE in Muffler#digest when Message is not yet set #1

Closed
mgrieder opened this issue Mar 8, 2014 · 1 comment
Closed

Potential NPE in Muffler#digest when Message is not yet set #1

mgrieder opened this issue Mar 8, 2014 · 1 comment

Comments

@mgrieder
Copy link

mgrieder commented Mar 8, 2014

I had the following Exception with Version 1.0.0

Exception in thread "Timer-0" java.lang.NullPointerException
    at com.eclecticlogic.whisper.core.Muffler.digest(Muffler.java:88)
    at com.eclecticlogic.whisper.core.WhisperManager.run(WhisperManager.java:122)
    at java.util.TimerThread.mainLoop(Unknown Source)
    at java.util.TimerThread.run(Unknown Source)

This is a race condition and is possible when the TimerThread is running between queuesByMessage.putIfAbsent and muffler.log in WispherManager#log: then lastMessage is not yet set.
I think it is enough to add a check for a Null Message in Muffler#digest

eclecticlogic pushed a commit that referenced this issue Mar 8, 2014
@eclecticlogic
Copy link
Collaborator

I don't think it is a race condition. It is just a plain flaw in the logic. If there is one error message and that message is not suppressed, the next digest run would result in a NPE. I've put in a fix and released v1.0.1. It may take a couple of hours for the maven central repo to show the artifact in the index. Thanks for the bug report.

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

1 participant