diff rep/REPCommandPacker.java @ 380:537a9c6c6d9c

*** empty log message ***
author kono
date Thu, 23 Oct 2008 10:19:04 +0900
parents 5ba5b7a9761b
children 4b87f89b3afd
line wrap: on
line diff
--- a/rep/REPCommandPacker.java	Wed Oct 22 18:27:13 2008 +0900
+++ b/rep/REPCommandPacker.java	Thu Oct 23 10:19:04 2008 +0900
@@ -41,7 +41,9 @@
 	 * @see rep.REPPack#packUConv(rep.REPCommand)
 	 */
 	public ByteBuffer packUConv(REPCommand command){
-    	ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+(command.string.length()*CHARSIZE));
+		int size = 0;
+		if (command.string!=null) size = command.string.length()*CHARSIZE;
+    	ByteBuffer buffer = ByteBuffer.allocateDirect(HEADER_SIZE+size);
     	buffer.clear();  // position = 0 
     	buffer.putInt(command.cmd.id);
     	buffer.putInt(command.sid);