[BUG] getServer()

Discussion in 'BungeeCord Plugin Development' started by kyku, Mar 4, 2013.

  1. Hi, i found bug in #219.

    BungeeCord.getInstance().getServer(SERVER_NAME) <- doesn't works (error)
    but
    BungeeCord.getInstance().getServers().get(SERVER_NAME) <- works fine


    Code (Text):
    mar 04, 2013 2:52:38 PM com.google.common.eventbus.EventBus dispatch
    SEVERE: Could not dispatch event: ......) to handler [.....]
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
            at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
            at com.google.common.eventbus.EventBus.dispatch(EventBus.java:302)
            at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:285)
            at com.google.common.eventbus.EventBus.post(EventBus.java:249)
            at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:214)
            at net.md_5.bungee.UserConnection$DownstreamBridge.run(UserConnection.java:394)
    Caused by: java.lang.NullPointerException
            at pl.xxx.xxxxx.onPluginMessageEvent(xxxxxx.java:72)
            ... 11 more
     
    // edit

    sorry, I did not know about https://github.com/ElasticPortalSuite/BungeeCord/issues
    to trash
     
  2. ProxyServer.getServer() is deprecated. Use ProxyServer.getServerInfo() instead (it may returns null if there is nobody on the server).