Thread: NullPointer

Results 1 to 6 of 6
  1. #1 NullPointer 
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Getting this error:

    Code:
    java.lang.NullPointerException
            at server.model.minigames.Barrows.ClickonChest(Barrows.java:37)
            at server.model.players.ActionHandler.firstClickObject(ActionHandler.jav
    a:416)
            at server.model.players.packets.ClickObject.processPacket(ClickObject.ja
    va:251)
            at server.model.players.PacketHandler.processPacket(PacketHandler.java:1
    41)
            at server.model.players.Client.processQueuedPackets(Client.java:1052)
            at server.model.players.PlayerHandler.process(PlayerHandler.java:192)
            at server.Server.main(Server.java:128)
    Here is barrows line 37:

    Code:
    if (this.c.barrowsKillCount < 5) {
    Here is actionhandler line 416:

    Code:
    Server.barrows.ClickonChest();
    Thanks for your time and help!
    Reply With Quote  
     

  2. #2  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    helps
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2011
    Age
    29
    Posts
    329
    Thanks given
    21
    Thanks received
    8
    Rep Power
    9
    send full method
    Vouches:
    Quote Originally Posted by Oleaa View Post
    Legit trader, thank you - fast and nice deal
    Google-> http://adf.ly/32uAA
    Reply With Quote  
     

  4. #4  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Here you go

    Code:
    	public void ClickonChest() {
    
    		if (this.c.barrowsKillCount < 5) {
    			this.c.sendMessage("You haven't killed all the brothers");
    		}
    		if ((this.c.barrowsKillCount == 5)
    				&& (this.c.barrowsNpcs[this.c.randomCoffin][1] == 1)) {
    			this.c.sendMessage("I have already summoned this npc.");
    		}
    		if ((this.c.barrowsNpcs[this.c.randomCoffin][1] == 0)
    				&& (this.c.barrowsKillCount >= 5)) {
    			Server.npcHandler.spawnNpc(this.c,
    					this.c.barrowsNpcs[this.c.randomCoffin][0], 3551, 9694 - 1,
    					0, 0, 120, 30, 200, 200, true, true);
    			this.c.barrowsNpcs[this.c.randomCoffin][1] = 1;
    		}
    		if (((this.c.barrowsKillCount > 5) || (this.c.barrowsNpcs[this.c.randomCoffin][1] == 2))
    				&& (this.c.getItems().freeSlots() >= 2)) {
    			this.c.getPA().resetBarrows();
    			this.c.getItems().addItem(this.c.getPA().randomRunes(),
    					Misc.random(130) + 100);
    			this.c.earthquake();
    			if (Misc.random(2) == 1) {
    				this.c.getItems().addItem(this.c.getPA().randomBarrows(), 1);
    			}
    			this.c.getPA().startTeleport(3564, 3288, 0, "modern");
    			this.c.resetCamera();
    		} else if ((this.c.barrowsKillCount > 5)
    				&& (this.c.getItems().freeSlots() <= 1)) {
    			this.c.sendMessage("You need at least 2 inventory slot opened.");
    		}
    	}
    Reply With Quote  
     

  5. #5  
    ZRPS
    Guest
    if(this == null || c == null){//which is practically impossible but your class is written terribly
    return;
    }
    Reply With Quote  
     

  6. #6  
    Dr. Jaegon


    Join Date
    Sep 2011
    Posts
    2,132
    Thanks given
    407
    Thanks received
    441
    Rep Power
    2559
    Isn't that some cheap fix?
    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. NullPointer
    By CTucker in forum Help
    Replies: 1
    Last Post: 03-16-2011, 07:55 PM
  2. NullPointer?
    By Phat 4 u in forum Help
    Replies: 21
    Last Post: 07-14-2010, 05:19 AM
  3. Nullpointer
    By Goro in forum Help
    Replies: 3
    Last Post: 07-14-2010, 12:53 AM
  4. NullPointer
    By Cjay00091 in forum Help
    Replies: 3
    Last Post: 06-20-2010, 04:24 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
  •