Pegasus Posted June 3, 2018 Share Posted June 3, 2018 org.osbot.rs07.api.model.Item.iiIiiiiiIiiI(rk:290) java.util.stream.MatchOps$1MatchSink.accept(Unknown Source) java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) Anyone know what code in osbot use java.util.stream.AbstractPipeline.copyIntoWithCancel? Quote Link to comment Share on other sites More sharing options...
Team Cape Posted June 3, 2018 Share Posted June 3, 2018 1 hour ago, Pegasus said: org.osbot.rs07.api.model.Item.iiIiiiiiIiiI(rk:290) java.util.stream.MatchOps$1MatchSink.accept(Unknown Source) java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) Anyone know what code in osbot use java.util.stream.AbstractPipeline.copyIntoWithCancel? Might help to see the code or know what you're trying to do with this Quote Link to comment Share on other sites More sharing options...
Pegasus Posted June 3, 2018 Author Share Posted June 3, 2018 (edited) 6 minutes ago, Team Cape said: Might help to see the code or know what you're trying to do with this thanks, I found out that it is caused by a filter variable. public Filter<Item> jewFilter = (jew) -> { return jew.nameContains(this.getAllCharged()); }; this.equipment.isWearingItem(JEW.getEquipmentSlot(), jewFilter)) I use this instead which works now this.equipment.isWearingItem(JEW.getEquipmentSlot(), new NameFilter<Item>(JEW.getAllCharged())) I am not familiar with filter class now. Edited June 3, 2018 by Pegasus Quote Link to comment Share on other sites More sharing options...
Team Cape Posted June 3, 2018 Share Posted June 3, 2018 2 hours ago, Pegasus said: thanks, I found out that it is caused by a filter variable. public Filter<Item> jewFilter = (jew) -> { return jew.nameContains(this.getAllCharged()); }; this.equipment.isWearingItem(JEW.getEquipmentSlot(), jewFilter)) I use this instead which works now this.equipment.isWearingItem(JEW.getEquipmentSlot(), new NameFilter<Item>(JEW.getAllCharged())) I am not familiar with filter class now. My guess is that some of your equipment slots were empty, so the items in there were returning null. You were calling a method on a null object as a result, which gave you the NPE. Filter is very straightforward. If you're not familiar with lambda, I'd recommend looking up what it's shorthand for, and you'll likely understand filters better Quote Link to comment Share on other sites More sharing options...
Pegasus Posted June 3, 2018 Author Share Posted June 3, 2018 1 hour ago, Team Cape said: My guess is that some of your equipment slots were empty, so the items in there were returning null. You were calling a method on a null object as a result, which gave you the NPE. Filter is very straightforward. If you're not familiar with lambda, I'd recommend looking up what it's shorthand for, and you'll likely understand filters better Your guess is correct. I didn't think about that the filter variable can be null. It is troublesome that NPE printstacktrace doesn't print the method Quote Link to comment Share on other sites More sharing options...