Added null checks to addFriend.py

This commit is contained in:
Treeku
2013-12-16 11:32:16 +00:00
parent 352937d77e
commit 0696edef9d
2 changed files with 2 additions and 3 deletions
+2 -1
View File
@@ -6,5 +6,6 @@ def setup():
def run(core, actor, target, commandString):
actorGhost = actor.getSlottedObject("ghost")
chatSrvc = core.chatService
chatSrvc.addFriend(actorGhost, commandString, 1)
if chatSrvc and actorGhost and commandString:
chatSrvc.addFriend(actorGhost, commandString, 1)
return
@@ -28,7 +28,6 @@ import org.apache.mina.core.buffer.IoBuffer;
import engine.resources.common.CRC;
import resources.common.StringUtilities;
import resources.objects.ObjectMessageBuilder;
import resources.objects.waypoint.WaypointObject;
@@ -357,7 +356,6 @@ public class PlayerMessageBuilder extends ObjectMessageBuilder {
int size = buffer.position();
buffer.flip();
buffer = createDelta("PLAY", (byte) 3, (short) 1, (short) 16, buffer, size + 4);
System.out.println(StringUtilities.bytesToHex(buffer.array()));
return buffer;
}