1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Nullpointer in GameObjectQueryBuilder#names()

Discussion in 'Client & Site Support' started by Defeat3d, Apr 17, 2015.

  1. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,025
    Likes Received:
    1,890
    Code (Text):
    1. (05:17:50) java.lang.NullPointerException
    2. (05:17:50)     at com.runemate.game.api.hybrid.util.Regex.getPatternForExactString(xpb:169)
    3. (05:17:50)     at com.runemate.game.api.hybrid.util.Regex.getPatternsForExactStrings(xpb:239)
    4. (05:17:50)     at com.runemate.game.api.hybrid.queries.GameObjectQueryBuilder.names(xvb:179)
    5. (05:17:50)     at productions.celestial.citadel.tasks.TeleportToCurrent.validate(TeleportToCurrent.java:25)
    6. (05:17:50)     at com.runemate.game.api.script.framework.task.TaskScript.onLoop(qxb:232)
    7. (05:17:50)     at com.runemate.game.api.script.framework.LoopingScript.run(htb:239)
    8. (05:17:50)     at com.runemate.game.api.script.framework.AbstractScript.start(jnb:156)
    9. (05:17:50)     at app.bj.run(ukb:214)
    My code:
    Code (Text):
    1.             final GameObjectQueryBuilder builder = GameObjects.newQuery().names(resource.getName()).actions(resource.getAction());
    resource#getName() is "Root".
     
  2. Best Answer:
    Post #2 by Cloud, Apr 18, 2015
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I'm pretty sure you're passing in null.
     
  4. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,025
    Likes Received:
    1,890
    Code (Text):
    1. TIMBER(false, Tab.WOODCUTTER, "Root", "Chop", 3, Teleport.WOODCUTTER)
    Root and Chop..
     
  5. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    The enum instance could be null
     
  6. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    Then resource.getName() should throw a NPE though?

    Maybe debug resource.getName() just to be absolutely sure what it's returning.
     
  7. Defeat3d

    Defeat3d Primate

    Joined:
    Oct 30, 2014
    Messages:
    3,025
    Likes Received:
    1,890
    Code (Text):
    1.         if (resource != null) {
    --- Double Post Merged, Apr 18, 2015, Original Post Date: Apr 18, 2015 ---
    I'll do that. It seems to happen when logged out or when loading into a new world a lot btw (entering a clan citadel puts you in a different world).
    --- Double Post Merged, Apr 19, 2015 ---
    I was indeed passing null because I'm retarded.
     
    SlashnHax likes this.

Share This Page

Loading...