if (obj instanceof LogoList) {
LogoList list = (LogoList) obj;
if (list.isEmpty()) {
throw new EngineException(context, this, I18N.errorsJ().get("org.nlogo.prim.etc.$common.emptyList"));
}
return list.first();
} else if (obj instanceof String) {
String string = (String) obj;
if (string.length() == 0) {
throw new EngineException(context, this, I18N.errorsJ().get("org.nlogo.prim.etc.$common.emptyString"));
}