diff options
Diffstat (limited to 'src/main/java/ftbsc/lll/tools/InsnSequence.java')
-rw-r--r-- | src/main/java/ftbsc/lll/tools/InsnSequence.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/ftbsc/lll/tools/InsnSequence.java b/src/main/java/ftbsc/lll/tools/InsnSequence.java index 4afd626..1e667f5 100644 --- a/src/main/java/ftbsc/lll/tools/InsnSequence.java +++ b/src/main/java/ftbsc/lll/tools/InsnSequence.java @@ -8,7 +8,7 @@ import java.util.Objects; /** * Represents a sequence of instructions contained within two given nodes. - * Extends InsnList, but provides additional flexibility. + * Extends InsnList, but provides additional flexibility and features. */ public class InsnSequence extends InsnList { /** @@ -55,6 +55,16 @@ public class InsnSequence extends InsnList { */ public void add(AbstractInsnNode... nodes) { for(AbstractInsnNode node : nodes) + this.add(node); + } + + /** + * Wraps InsnList's add() to ignore null values. + * @param node to add + */ + @Override + public void add(AbstractInsnNode node) { + if(node != null) super.add(node); } |