Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of column error check in importer #28

Merged

Conversation

subins2000
Copy link
Collaborator

@subins2000 subins2000 commented Jul 15, 2023

To set e.Initial, it accesses e.Content[0] but if the content is empty this will cause a runtime error. Moving the emptiness check of Content before e.Initial column check will fix this.

The error before:

2023/07/15 14:54:40 init.go:215: language: english
2023/07/15 14:54:40 init.go:215: language: malayalam
2023/07/15 14:54:40 main.go:172: importing data from ../export.csv ...
panic: runtime error: index out of range [0] with length 0

After:

2023/07/15 14:56:08 main.go:172: importing data from ../export.csv ...
2023/07/15 14:56:08 main.go:174: error reading line 233: empty content (word) at column 1
exit status 1

@subins2000 subins2000 merged commit 1d58374 into knadh:master Jul 15, 2023
@subins2000 subins2000 deleted the fix-import-column-error-check-order branch July 15, 2023 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant