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

Bug Ground Item nullpointer

Discussion in 'Developer Support' started by Ancillary, Dec 24, 2020.

  1. Ancillary

    Joined:
    Dec 23, 2020
    Messages:
    1
    Likes Received:
    0
    using the following code and getting the following error, this is on a rooftop course btw:

    Code (Text):
    1. GroundItem mark = GroundItems.newQuery().names("Mark of grace").results().nearest();

    Code (Text):
    1. java.lang.NullPointerException
    2.     at nul.iIIiIIiiIiIiI.IiiIIiiiiIiIi(zmc:179)
    3.     at com.runemate.game.api.hybrid.region.Region.getCurrentPlane(hha:15)
    4.     at nul.IiiiiIiiIiiiI.IiiIIiiiiIiIi(ohc:145)
    5.     at com.runemate.game.api.hybrid.region.GroundItems.getLoaded(wvc:132)
    6.     at com.runemate.game.api.hybrid.region.GroundItems.getLoaded(wvc:145)
    7.     at com.runemate.game.api.hybrid.queries.GroundItemQueryBuilder.IiiIIiiiiIiIi(iyc:21)
    8.     at com.runemate.game.api.hybrid.queries.QueryBuilder.IiiIIiiiiIiIi(pjc:221)
    9.     at com.runemate.game.api.hybrid.queries.QueryBuilder.results(pjc:162)
    10.     at com.ancillary.bots.anagility.nodes.NavigateObstacleNode.takeGraceMark(NavigateObstacleNode.java:89)
    11.     at com.ancillary.bots.anagility.nodes.NavigateObstacleNode.execute(NavigateObstacleNode.java:42)
    12.     at com.ancillary.bots.anagility.AnAgility.onLoop(AnAgility.java:34)
    13.     at com.runemate.game.api.script.framework.LoopingBot.run(lgc:165)
    14.     at com.runemate.game.api.script.framework.AbstractBot.start(nhc:505)
    15.     at nul.IiiIiIiiiiiiI.run(vvc:159)
    literally the next line i am checking if mark != null, but the NPE is on the line where i am running the query.
     
  2. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,121
    Likes Received:
    1,378
    Code (Text):
    1. GroundItems.newQuery().names("Mark of grace").results()
    Can rarely return null. You need to nullcheck the query results before calling nearest() to avoid this.
     
  3. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    wrong

    its just a client issue, nothing you can do about it
     
    CuppaJava likes this.
  4. CuppaJava

    CuppaJava cuppa.drink(java);

    Joined:
    Mar 13, 2018
    Messages:
    6,121
    Likes Received:
    1,378
    Fair enough, that's just what I was told a long time ago. I do still get these in my exception logs sometimes so I assume you're right.
     

Share This Page

Loading...