Skip to content
Snippets Groups Projects
Commit 6d12b0f6 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

Fixed regression on VarMutableArray to fix Batch Protocol loading

parent 3c85063d
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ public class VarMutableArray extends VarMutable implements Iterable<Object>
throws IllegalArgumentException
{
super(name, initialType, defaultListener);
if (!initialType.isArray())
if ((initialType != null) && !initialType.isArray())
throw new IllegalArgumentException("The initial type " + initialType + " is not an array type");
}
......@@ -94,7 +94,7 @@ public class VarMutableArray extends VarMutable implements Iterable<Object>
@Override
public void setType(Class<?> newType) throws IllegalArgumentException
{
if (!newType.isArray())
if ((newType != null) && !newType.isArray())
throw new IllegalArgumentException("The new type " + newType + " is not an array type");
super.setType(newType);
}
......@@ -125,9 +125,7 @@ public class VarMutableArray extends VarMutable implements Iterable<Object>
public Iterator<Object> iterator()
{
if (getValue() == null)
{
return Collections.emptyList().iterator();
}
return Arrays.asList(getValue()).iterator();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment