Maintaining previous font using XSSFRichTextString
I'm getting the contents of a cell and then appending a `\n` and then putting the contents back in the cell. I'm getting the contents as `XSSFRichTextString` and use the `applyFont()` method to reapply the formatting of the formatting to the original cell contents. Heres my code <br>
` Append \n to previous content <br>

		XSSFRichTextString prevContent = cell.getRichStringCellValue();
		
		XSSFRichTextString val = new XSSFRichTextString(prevContent.toString() + "\n");
		
		// Apply Previous Formatting
		for (int i = 0; i < prevContent.toString().length(); i++) {

			val.applyFont(i, i + 1,  prevContent.getFontAtIndex(i));
		}

		cell.setCellValue(val);`

<br>Im getting a null pointer exception here. I think its cos is the previous content has no font set. Please help me.
Maintaining previous font using XSSFRichTextString
===

I'm getting the contents of a cell and then appending a `\n` and then putting the contents back in the cell. I'm getting the contents as `XSSFRichTextString` and use the `applyFont()` method to reapply the formatting of the formatting to the original cell contents. Heres my code <br>
` Append \n to previous content <br>

		XSSFRichTextString prevContent = cell.getRichStringCellValue();
		
		XSSFRichTextString val = new XSSFRichTextString(prevContent.toString() + "\n");
		
		// Apply Previous Formatting
		for (int i = 0; i < prevContent.toString().length(); i++) {

			val.applyFont(i, i + 1,  prevContent.getFontAtIndex(i));
		}

		cell.setCellValue(val);`

<br>Im getting a null pointer exception here. I think its cos is the previous content has no font set. Please help me.