if (value == null || value instanceof UndefinedData || value instanceof NullData) {
return NullData.INSTANCE;
} else {
throw new RenderException(
"While evaluating \"" + node.toSourceString() + "\", encountered non-collection" +
" just before accessing \"" + accessNode.toSourceString() + "\".");
}
} else {
// This behavior is not ideal, but needed for compatibility with existing code.
return UndefinedData.INSTANCE;
// TODO: If feasible, find and fix existing instances, then enable this exception.