Merge change 6183 into donut
* changes: Fix null data handling in ServiceCommand.writeCommand()
This commit is contained in:
@@ -140,7 +140,7 @@ public class ServiceCommand {
|
|||||||
|
|
||||||
private boolean writeCommand(int cmd, String _data) {
|
private boolean writeCommand(int cmd, String _data) {
|
||||||
byte buf[] = new byte[8];
|
byte buf[] = new byte[8];
|
||||||
byte[] data = _data.getBytes();
|
byte[] data = (_data == null) ? new byte[0] : _data.getBytes();
|
||||||
int len = data.length;
|
int len = data.length;
|
||||||
// the length of data
|
// the length of data
|
||||||
buf[0] = (byte) (len & 0xff);
|
buf[0] = (byte) (len & 0xff);
|
||||||
|
|||||||
Reference in New Issue
Block a user