Thread: NullPointer

Results 1 to 9 of 9
  1. #1 NullPointer 
    Registered Member
    Join Date
    Apr 2016
    Posts
    117
    Thanks given
    4
    Thanks received
    3
    Rep Power
    36
    Code:
    [11/18/18 9:17 AM]: java.lang.NullPointerException
    [11/18/18 9:17 AM]: 	at server.model.players.KillStreak.killedPlayer(KillStreak.java:60)
    [11/18/18 9:17 AM]: 	at server.model.players.PlayerAssistant.applyDead(PlayerAssistant.java:851)
    [11/18/18 9:17 AM]: 	at server.model.players.Client.process(Client.java:995)
    [11/18/18 9:17 AM]: 	at server.model.players.PlayerHandler.process(PlayerHandler.java:162)
    [11/18/18 9:17 AM]: 	at server.Server$1.execute(Server.java:161)
    [11/18/18 9:17 AM]: 	at server.task.Task.execute(Task.java:21)
    [11/18/18 9:17 AM]: 	at server.task.Executor.executeRemainingTasks(Executor.java:100)
    [11/18/18 9:17 AM]: 	at server.task.Executor.access$1(Executor.java:79)
    [11/18/18 9:17 AM]: 	at server.task.Executor$1.run(Executor.java:63)
    [11/18/18 9:17 AM]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    [11/18/18 9:17 AM]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    [11/18/18 9:17 AM]: 	at java.lang.Thread.run(Unknown Source)
    playerassiant.java
    Attached image
    killstreak.java
    Attached image
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    which is line 60?
    Reply With Quote  
     

  3. #3  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Spooky View Post
    which is line 60?
    The one with the number 60 next to it.
    Attached image

    'o' is null.
    Attached image
    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by Kris View Post
    The one with the number 60 next to it.
    Attached image

    'o' is null.
    didn't even see them lmfao
    Reply With Quote  
     

  6. #5  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    In your killedPlayer check if your c is nulled
    Code:
    if(c == null) System.out.println("c is null!");


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Apr 2016
    Posts
    117
    Thanks given
    4
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by arch337 View Post
    In your killedPlayer check if your c is nulled
    Code:
    if(c == null) System.out.println("c is null!");
    did nothing?
    Reply With Quote  
     

  8. #7  
    ⚓Manic-Owner⚓


    Join Date
    Nov 2007
    Posts
    2,711
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    was this solved?
    Reply With Quote  
     

  9. #8  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by TheRealGenesis View Post
    did nothing?
    If you added your code under killedPlayer and it printed out that c was null in the commando prompt then you know that is your issue.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  10. #9  
    Extreme Donator


    Join Date
    Oct 2010
    Posts
    2,853
    Thanks given
    1,213
    Thanks received
    1,622
    Rep Power
    5000
    Quote Originally Posted by arch337 View Post
    If you added your code under killedPlayer and it printed out that c was null in the commando prompt then you know that is your issue.
    But we already know what the issue is? Line 60 tells us that either c or o is null. If c was null then the nullptr would have occured on line 59 instead.

    Quote Originally Posted by TheRealGenesis View Post
    did nothing?
    c.killerId isn't being set to the player that was killed, meaning o will return null. To prevent the error, add a null-check under line 59. Obviously this will not fix the real problem but will only prevent the exception from being thrown. If you want to fix the real problem, make sure c.killerId is set correctly.
    Code:
    if (o == null) {
    return;
    }
    [Today 01:29 AM] RSTrials: Nice 0.97 Win/Loss Ratio luke. That's pretty bad.
    [Today 01:30 AM] Luke132: Ok u fucking moron i forgot i could influence misc.random
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Pinpointing Nullpointers
    By Soulevoker in forum Help
    Replies: 9
    Last Post: 08-07-2009, 01:58 AM
  2. [508] PVP drops nullpointer
    By feefs in forum Help
    Replies: 6
    Last Post: 06-21-2009, 08:55 PM
  3. PlayerCombat Nullpointers?
    By Soulevoker in forum Help
    Replies: 9
    Last Post: 05-05-2009, 02:00 AM
  4. nullpointer and pimp fatal
    By Mister Maggot in forum Help
    Replies: 11
    Last Post: 01-21-2009, 02:33 AM
  5. Huge nullpointer
    By `Lubricant in forum RS 503+ Client & Server
    Replies: 3
    Last Post: 09-15-2008, 08:53 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •