Skip to content
Snippets Groups Projects
Commit 1836d8f3 authored by Zoey76's avatar Zoey76
Browse files

BETA: Fixing minor NPE vulnerability on TvT Manager.

Reported by: siphonex
parent 2b7773db
No related branches found
No related tags found
No related merge requests found
...@@ -163,32 +163,38 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan ...@@ -163,32 +163,38 @@ public final class TvTManager extends AbstractNpcAI implements IVoicedCommandHan
@Override @Override
public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params) public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
{ {
String html = null;
switch (command) switch (command)
{ {
case "tvt": case "tvt":
{ {
if (TvTEvent.isStarting() || TvTEvent.isStarted()) if (TvTEvent.isStarting() || TvTEvent.isStarted())
{ {
activeChar.sendPacket(new NpcHtmlMessage(getTvTStatus(activeChar))); html = getTvTStatus(activeChar);
} }
else else
{ {
activeChar.sendMessage("The event has not started."); html = "The event has not started.";
} }
break; break;
} }
case "tvtjoin": case "tvtjoin":
{ {
activeChar.sendPacket(new NpcHtmlMessage(onAdvEvent("join", null, activeChar))); html = onAdvEvent("join", null, activeChar);
break; break;
} }
case "tvtleave": case "tvtleave":
{ {
activeChar.sendPacket(new NpcHtmlMessage(onAdvEvent("remove", null, activeChar))); html = onAdvEvent("remove", null, activeChar);
break; break;
} }
} }
return false;
if (html != null)
{
activeChar.sendPacket(new NpcHtmlMessage(html));
}
return true;
} }
private String getTvTStatus(L2PcInstance player) private String getTvTStatus(L2PcInstance player)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment