invalid memory address or nil pointer dereference
davisonio opened this issue · comments
I get this error when attempting ./timeliner add-account google_photos/craig.davison3@gmail.com
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4367335]
goroutine 1 [running]:
github.com/mholt/timeliner.authorizeWithOAuth2(0x463ed5a, 0x6, 0x4a16410, 0x1, 0x1, 0x4363f34, 0x45cde60, 0xc000100200, 0x0, 0x0)
/Users/craig/go/src/github.com/mholt/timeliner/oauth2.go:57 +0x65
github.com/mholt/timeliner.DataSource.authFunc.func1(0x7ffeefbffade, 0x18, 0x4641041, 0xd, 0x463ed5a, 0x6, 0x4a16410)
/Users/craig/go/src/github.com/mholt/timeliner/datasource.go:116 +0x3c
github.com/mholt/timeliner.(*Timeline).AddAccount(0xc00000d1a0, 0x7ffeefbffad0, 0xd, 0x7ffeefbffade, 0x18, 0x1, 0x0)
/Users/craig/go/src/github.com/mholt/timeliner/account.go:69 +0x754
main.main()
/Users/craig/go/src/github.com/mholt/timeliner/cmd/timeliner/main.go:82 +0x3b9
Oh, I bet you're missing a config file: https://github.com/mholt/timeliner#tutorial
I might change the name of the default file to timeliner.toml
soon, FYI.
We should improve the handling of this situation and show a proper error when the config file is missing.
Ah yeah that's the problem thanks!
Yeah, so the thing is that right now, a config file is not needed if OAuth2 is not needed, like if you only add data from downloaded archive files.
But I might move more of the config (like current CLI flags) into a config file instead.
However, I'm not totally decided. I think I'm leaning toward the config file being optional.
I'm not quiiiite sure the best way to do this yet, but let me know what you think and we could talk about it!