@@ -459,7 +459,7 @@ private void setFormattedCellValue(Workbook wb, JSONObject visualizationType, St
459459 case "int" :
460460 if (!stringifiedValue .trim ().isEmpty ()) {
461461 cell .getCellStyle ().setDataFormat (getFormat (visualizationType , creationHelper ));
462- if (visualizationType .has ("prefix" ) || visualizationType .has ("suffix" )) {
462+ if (visualizationType != null && ( visualizationType .has ("prefix" ) || visualizationType .has ("suffix" ) )) {
463463 stringifiedValue = visualizationType .optString ("prefix" , "" ) + stringifiedValue ;
464464 if (visualizationType .has ("precision" )) {
465465 int precision = visualizationType .getInt ("precision" );
@@ -477,7 +477,7 @@ private void setFormattedCellValue(Workbook wb, JSONObject visualizationType, St
477477 case "float" :
478478 if (!stringifiedValue .trim ().isEmpty ()) {
479479 cell .getCellStyle ().setDataFormat (getFormat (visualizationType , creationHelper ));
480- if (visualizationType .has ("prefix" ) || visualizationType .has ("suffix" )) {
480+ if (visualizationType != null && ( visualizationType .has ("prefix" ) || visualizationType .has ("suffix" ) )) {
481481 if (visualizationType .has ("precision" )) {
482482 int precision = visualizationType .getInt ("precision" );
483483 double doubleValue = Double .parseDouble (stringifiedValue );
@@ -497,7 +497,7 @@ private void setFormattedCellValue(Workbook wb, JSONObject visualizationType, St
497497 try {
498498 if (!stringifiedValue .trim ().isEmpty ()) {
499499 cell .getCellStyle ().setDataFormat (getFormat (visualizationType , creationHelper ));
500- if (visualizationType .has ("prefix" ) || visualizationType .has ("suffix" )) {
500+ if (visualizationType != null && ( visualizationType .has ("prefix" ) || visualizationType .has ("suffix" ) )) {
501501 stringifiedValue = visualizationType .optString ("prefix" , "" ) + stringifiedValue ;
502502 stringifiedValue = stringifiedValue + visualizationType .optString ("suffix" , "" );
503503 cell .setCellValue (stringifiedValue );
@@ -513,7 +513,7 @@ private void setFormattedCellValue(Workbook wb, JSONObject visualizationType, St
513513 break ;
514514 case "string" :
515515 if (!stringifiedValue .trim ().isEmpty ()) {
516- if (visualizationType .has ("prefix" ) || visualizationType .has ("suffix" )) {
516+ if (visualizationType != null && ( visualizationType .has ("prefix" ) || visualizationType .has ("suffix" ) )) {
517517 stringifiedValue = visualizationType .optString ("prefix" , "" ) + stringifiedValue ;
518518 stringifiedValue = stringifiedValue + visualizationType .optString ("suffix" , "" );
519519 }
0 commit comments