hugolib: Only set 'allThemes' if there are themes in the config file
authorGarry McNulty <garrmcnu@gmail.com>
Sun, 15 Jul 2018 13:35:41 +0000 (14:35 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 15 Jul 2018 14:13:48 +0000 (16:13 +0200)
commit38204c4ab6fa2aa2ab8bd06ddb3e07b66e5f9646
tree70b712eea09df942d76952868a30b940e9547657
parent2f2bc7ff70b90fb11580cc092ef3883bf68d8ad7
hugolib: Only set 'allThemes' if there are themes in the config file

When the 'allThemes' configuration setting is read, it will panic if
there are no themes. This was a regression introduced in Hugo 0.42.

Also updated a unit test to check for this.

Fixes #4851
hugolib/config.go
hugolib/config_test.go