You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 22, 2022. It is now read-only.
When adding a null value to a cell, you get an TypeError: Cannot read property 'match' of null error.
Example
var xl = require('excel4node');
//Create Workbook
var wb= new xl.Workbook();
let sheet1= wb.addWorksheet('Test');
sheet1.cell(1,1).string('Test');
//set empty cell
sheet1.cell(2, 1).string(null);
I expected the lib to handle null values or give a more descriptive error when they happen.
The text was updated successfully, but these errors were encountered:
I'm going to mark this as a bug. I think the best solution for this one would be to forcibly coerce any value sent to cell.string() to a string. This would print out the word "null" in the cell when the method is passed a null value. This would also would put strings like "undefined" and "[object Object]".
it turns out I had already had code to handle non-string values being passed to the string method but a bug was preventing that code from being applied. That is resolved in version 1.5.1. non-string values will be replaced with empty strings and a warning will be logged to the console if the workbook was initialized with a log level above warn.
When adding a
null
value to a cell, you get anTypeError: Cannot read property 'match' of null
error.Example
I expected the lib to handle null values or give a more descriptive error when they happen.
The text was updated successfully, but these errors were encountered: