Apache-POI XSSFRichTextString错误

时间:2015-12-15 13:43:17

标签: java nullpointerexception apache-poi

如果第一组单词未格式化,则调用richText.getFontOfFormattingRun(index) throws a NullPointerException。这是一个Apache POI错误吗?

 XSSFRichTextString rt = (XSSFRichTextString) cell.getRichStringCellValue ();
 if (rt.numFormattingRuns () > 0)
 {
    content = "";
    for (int t = 0; t < rt.numFormattingRuns (); t++)
    {
      if(rt.getFontOfFormattingRun (t) != null)
        //handle the content based on the formatting

0 个答案:

没有答案