mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Avoid an error when pasting data with first row shorter than the rest
Summary: Pasting data like `A\nB\tC` was failing because the first row, used for checking column type (to handle rich data), was failing on an undefined value. Discovered while trying out the fix in https://phab.getgrist.com/D3110. Test Plan: Tested manually. The case mentioned now works as expected. Reviewers: alexmojaki Reviewed By: alexmojaki Differential Revision: https://phab.getgrist.com/D3111
This commit is contained in:
parent
dc2aee4be9
commit
0dd4ad34f5
@ -373,7 +373,7 @@ BaseView.prototype._parsePasteForView = function(data, fields) {
|
|||||||
if (!col.length) {
|
if (!col.length) {
|
||||||
return col;
|
return col;
|
||||||
}
|
}
|
||||||
const typeMatches = col[0].colType === updateColTypes[idx];
|
const typeMatches = col[0] && col[0].colType === updateColTypes[idx];
|
||||||
const parser = parsers[idx];
|
const parser = parsers[idx];
|
||||||
return col.map(v => {
|
return col.map(v => {
|
||||||
if (v) {
|
if (v) {
|
||||||
|
Loading…
Reference in New Issue
Block a user