- List<ActionsList> actions = instruction.getAugmentation(ActionsInstruction.class).getActionsList();
- out.writeShort(ACTIONS_INSTRUCTION_LENGTH + ActionsSerializer.computeLengthOfActions(actions));
- ByteBufUtils.padBuffer(PADDING_IN_ACTIONS_INSTRUCTION, out);
- ActionsSerializer.encodeActions(actions, out);
+ if (instruction.getAugmentation(ActionsInstruction.class) != null) {
+ List<ActionsList> actions = instruction.getAugmentation(ActionsInstruction.class).getActionsList();
+ out.writeShort(ACTIONS_INSTRUCTION_LENGTH + ActionsSerializer.computeLengthOfActions(actions));
+ ByteBufUtils.padBuffer(PADDING_IN_ACTIONS_INSTRUCTION, out);
+ ActionsSerializer.encodeActions(actions, out);
+ } else {
+ out.writeShort(ACTIONS_INSTRUCTION_LENGTH);
+ ByteBufUtils.padBuffer(PADDING_IN_ACTIONS_INSTRUCTION, out);
+ }