bennidi / mbassador

Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
MIT License
955 stars 146 forks source link

Using BusConfiguration throws NullPointerException #124

Closed nikoliazekter closed 8 years ago

nikoliazekter commented 9 years ago

This code throws NullPointerException:

    BusConfiguration config = new BusConfiguration();
    MBassador<Object> eventBus = new MBassador<Object>(config);

Exception in thread "LWJGL Application" java.lang.NullPointerException at net.engio.mbassy.bus.AbstractPubSubSupport.(AbstractPubSubSupport.java:49) at net.engio.mbassy.bus.AbstractSyncAsyncMessageBus.(AbstractSyncAsyncMessageBus.java:36) at net.engio.mbassy.bus.MBassador.(MBassador.java:45)

bennidi commented 9 years ago

True. This way of construction was not meant to be supported. Either use default constructor of bus or specify full configuration object. I might reconsider this decision as it seems bad design that this code simply errors with an NPE.

bennidi commented 8 years ago

I fixed the NPE and replaced it with a more meaningful error message. This is available with the 1.2.4 release.