Closed timoreimann closed 1 month ago
Hi @timoreimann, sorry I've been a bit busy to take care of this project lately. If you send a PR I'll merge it. Otherwise it might be a bit before I can loop back on this issue.
sure thing @aybabtme, happy to submit something. Thanks, and stay tuned :)
@KevRiver this is a good one to get started with
@timoreimann seems like this was fixed by @KevRiver (thanks!)
Sorry for having dropped the ball on this one. @KevRiver thanks for addressing the issue!
Hello š
if I create a
config.json
file like thishumanlog (v0.7.5) crashes with
I believe this happens because both fields are defined as string slice pointers
*[]string
, and when only one is specified the other is nil and thus causes a nil pointer dereference here:(It does not happen when no configuration file is used because the fields get defaulted to non-nil empty string slice pointers in that case.)
A workaround is to define the other field as an empty JSON array in the configuration file. Ideally though, that shouldn't be required.
One fix could be to extend the condition by a nilness check before de-referencing. However, I do wonder if those fields could be regular string slices instead -- a quick scan of mine didn't yield that the code cares about distinguishing between absent and empty values, but I could have missed something. If not though, then my personal suggestion would be to de-pointerize the fields in order to simplify things.
Let me know what you think. Either way, I'd be happy to submit a quick PR.