Why was this null? Right clicking player and sending duel request via "Challenge" option produces an NPE, because packet is null, but ChallengePlayer checks packet.getOpcode() value without checking if packet is null first. Dueling, sending a challenge, etc all that still works fine even with an NPE but why have an NPE in the first place?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/2006-Scape/2006Scape/pull/650
**Author:** [@ipkpjersi](https://github.com/ipkpjersi)
**Created:** 12/31/2023
**Status:** 🔄 Open
**Base:** `master` ← **Head:** `fix-dueling-npe`
---
### 📝 Commits (2)
- [`295af8f`](https://github.com/2006-Scape/2006Scape/commit/295af8f574d4e0ca900ce851802fc3bc9474ba03) Fixed dueling NPE
- [`4548d5a`](https://github.com/2006-Scape/2006Scape/commit/4548d5ad9fb09c8462316ec831eafad074abda13) Added bounds check
### 📊 Changes
**2 files changed** (+2 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `2006Scape Server/src/main/java/com/rs2/net/packets/impl/AttackPlayer.java` (+1 -1)
📝 `2006Scape Server/src/main/java/com/rs2/net/packets/impl/ChallengePlayer.java` (+1 -1)
</details>
### 📄 Description
Why was this null? Right clicking player and sending duel request via "Challenge" option produces an NPE, because packet is null, but ChallengePlayer checks packet.getOpcode() value without checking if packet is null first. Dueling, sending a challenge, etc all that still works fine even with an NPE but why have an NPE in the first place?
This closes #639 but is it correct?
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/2006-Scape/2006Scape/pull/650
Author: @ipkpjersi
Created: 12/31/2023
Status: 🔄 Open
Base:
master← Head:fix-dueling-npe📝 Commits (2)
295af8fFixed dueling NPE4548d5aAdded bounds check📊 Changes
2 files changed (+2 additions, -2 deletions)
View changed files
📝
2006Scape Server/src/main/java/com/rs2/net/packets/impl/AttackPlayer.java(+1 -1)📝
2006Scape Server/src/main/java/com/rs2/net/packets/impl/ChallengePlayer.java(+1 -1)📄 Description
Why was this null? Right clicking player and sending duel request via "Challenge" option produces an NPE, because packet is null, but ChallengePlayer checks packet.getOpcode() value without checking if packet is null first. Dueling, sending a challenge, etc all that still works fine even with an NPE but why have an NPE in the first place?
This closes #639 but is it correct?
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.