mirror of
https://github.com/charmbracelet/gum
synced 2024-05-04 15:33:14 +02:00
fix: reject empty table data
When we treat the first line of a table as its column data, we need to check if additional data was provided afterwards. Fixes #304.
This commit is contained in:
parent
f46060ac43
commit
af9d065816
|
@ -53,7 +53,7 @@ func (o Options) Run() error {
|
|||
}
|
||||
|
||||
data, err := reader.ReadAll()
|
||||
if err != nil {
|
||||
if err != nil || len(data) == 0 {
|
||||
return fmt.Errorf("invalid data provided")
|
||||
}
|
||||
var columns = make([]table.Column, 0, len(columnNames))
|
||||
|
|
Loading…
Reference in a new issue