diff --git a/protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java b/protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java index be2517bf6c..ee6e2051d2 100644 --- a/protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java +++ b/protocol/src/main/java/org/opensearch/sql/protocol/response/format/FlatResponseBase.java @@ -84,7 +84,7 @@ protected List> formatData(List> lines) { protected String quoteIfRequired(String separator, String cell) { final String quote = "\""; - if (cell != null && (cell.contains(separator) || cell.contains(quote))) { + if (cell.contains(separator) || cell.contains(quote)) { return quote + cell.replaceAll(quote, quote + quote) + quote; } else { return cell;