ICU-8854 possible null pointer dereference.

X-SVN-Rev: 30839
This commit is contained in:
Abhinav Gupta 2011-10-17 20:24:17 +00:00
parent 9c83ba6e64
commit 728bdac7fa

View File

@ -3908,6 +3908,8 @@ public class DecimalFormat extends NumberFormat {
text = format(number.doubleValue(), new StringBuffer(), new FieldPosition(0), true);
} else if (obj instanceof Integer || obj instanceof Long) {
text = format(number.longValue(), new StringBuffer(), new FieldPosition(0), true);
} else {
throw new IllegalArgumentException();
}
AttributedString as = new AttributedString(text.toString());