Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
odfdom-0.8.5
-
None
-
Operating System: Windows
Platform: PC
-
193
Description
I use Table API to read a *.ods documnet. Some time a NullPointerException will be thrown when call OdfTableCell.getCurrencyValue(). This method is realized as follow in ODFDOM:
public double getCurrencyValue() {
if (getTypeAttr() == OfficeValueTypeAttribute.Value.CURRENCY)
else
{ throw new IllegalArgumentException(); } }
The reason that NullPointerException thrown is mCellElement.getOfficeValueAttribute() get null value.
Obviously, getOfficeValueAttribute() return null is valid. Such as, the cell is set as CURRENCY type, but it isn't given a value. The return value of mCellElement.getOfficeValueAttribute() should be checked and a default currency value may be needed.