Francesco149 / gweet

A sharenix plugin that uploads images and videos to twitter.
GNU General Public License v3.0
3 stars 0 forks source link

Tweeting without an image crashes the app #3

Closed notpushkin closed 7 years ago

notpushkin commented 7 years ago

I know it defeats the purpose, but the Optional if the tweet contains at least one media file. phrase in help text suggests that it is not a desired behavour.

$ gweet -text "test... test... test..."
gweet 1.1.0

2017/06/22 00:55:35 Loading config from /home/ale/.local/bin/gweet.json
2017/06/22 00:55:35 Initializing API interface for account iamale_ru
2017/06/22 00:55:35 Tweeting {"test... test... test...", [], lewd=false}.
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.(*gweet).tweet(0xc820010aa0, 0xc820012700, 0x7ffd3b57beeb, 0x17, 0xc82000a440, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    /media/loli/WD-tan/coding/go/src/github.com/Francesco149/gweet/main.go:200 +0x1c41
main.main()
    /media/loli/WD-tan/coding/go/src/github.com/Francesco149/gweet/main.go:262 +0x680

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /home/loli/go/src/runtime/asm_amd64.s:1805 +0x1

goroutine 5 [chan receive]:
github.com/ChimeraCoder/anaconda.(*TwitterApi).throttledQuery(0xc820012700)
    /media/loli/WD-tan/coding/go/src/github.com/ChimeraCoder/anaconda/twitter.go:246 +0xb7
created by github.com/ChimeraCoder/anaconda.NewTwitterApi
    /media/loli/WD-tan/coding/go/src/github.com/ChimeraCoder/anaconda/twitter.go:115 +0x1c6
Francesco149 commented 7 years ago

yeah, this is not intended - it's probably because it tries to trim an empty string after looping over the files.

will fix