Giter VIP home page Giter VIP logo

csveditor's People

Contributors

hfmrow avatar

Stargazers

 avatar

Watchers

 avatar  avatar

csveditor's Issues

Crash while creating new csv file

Steps to replicate:

  1. run csveditor
  2. click "New CSV File"
  3. enter some fields, eg "a,b,c"
  4. enter filename, eg "/tmp/abc.csv"

Crashes with the following stackdump:

panic: runtime error: index out of range
goroutine 1 [running, locked to thread]:
main.(*ProfileCsv).Init(0xc42011b458, 0xc420018224, 0xc)
	/home/ben/go/src/github.com/hfmrow/csveditor/csvprofile.go:103 +0x14b2
main.NewProfileCsv(0xc420018224, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/ben/go/src/github.com/hfmrow/csveditor/csvprofile.go:28 +0xa5
main.rwProfileCsv(0xc420018224, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/home/ben/go/src/github.com/hfmrow/csveditor/rwProfileCsv.go:90 +0xcf
main.addAndSetCsv(0xc420018224, 0xc, 0x5ce011, 0x4)
	/home/ben/go/src/github.com/hfmrow/csveditor/rwProfileCsv.go:102 +0x50
main.newTableWindow.func3(0xc420096930)
	/home/ben/go/src/github.com/hfmrow/csveditor/newTableWindow.go:81 +0x4db
github.com/andlabs/ui.pkguiDoButtonOnClicked(0x14a48f0, 0x0)
	/home/ben/go/src/github.com/andlabs/ui/button.go:60 +0x7b
github.com/andlabs/ui._cgoexpwrap_b057800ccea7_pkguiDoButtonOnClicked(0x14a48f0, 0x0)
	_cgo_gotypes.go:3862 +0x35
github.com/andlabs/ui._Cfunc_uiMain()
	_cgo_gotypes.go:2518 +0x41
github.com/andlabs/ui.Main(0x5e11c0, 0x5e10c0, 0xc4200162e0)
	/home/ben/go/src/github.com/andlabs/ui/main.go:41 +0xfe
main.main()
	/home/ben/go/src/github.com/hfmrow/csveditor/main.go:28 +0x142

(This is on Linux, btw).

Looking at the source, it seems it's crashing while trying to guess datatypes for the columns. The tmpCsv := CSVReadCsv(...) call is returning an empty array (which is reasonable, since the file doesn't exist), but the datatype-guessing code looks like it assumes there is always at least one row (containing the column names).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.