Robuster marshalling of PrepareDevices
@@ -493,10 +493,12 @@ public class Marshaller {
rootElement = createElementIso(document, o.getClass().getSimpleName());
appendRequestValues(prepareDevices, rootElement);
+ final byte[] contextHandle = prepareDevices.getContextHandle();
+ if (contextHandle != null) {
Element emContextHandle = createElementIso(document, "ContextHandle");
- emContextHandle.appendChild(document.createTextNode(ByteUtils.toHexString(prepareDevices.getContextHandle())));
+ emContextHandle.appendChild(document.createTextNode(ByteUtils.toHexString(contextHandle)));
rootElement.appendChild(emContextHandle);
-
+ }
} else if (o instanceof PrepareDevicesResponse) {
PrepareDevicesResponse resp = (PrepareDevicesResponse) o;
rootElement = createElementIso(document, o.getClass().getSimpleName());
