summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/highlight/highlight.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/highlight/highlight.go b/modules/highlight/highlight.go
index acd3bebb9f..6832207c0f 100644
--- a/modules/highlight/highlight.go
+++ b/modules/highlight/highlight.go
@@ -40,9 +40,11 @@ var (
// NewContext loads custom highlight map from local config
func NewContext() {
once.Do(func() {
- keys := setting.Cfg.Section("highlight.mapping").Keys()
- for i := range keys {
- highlightMapping[keys[i].Name()] = keys[i].Value()
+ if setting.Cfg != nil {
+ keys := setting.Cfg.Section("highlight.mapping").Keys()
+ for i := range keys {
+ highlightMapping[keys[i].Name()] = keys[i].Value()
+ }
}
// The size 512 is simply a conservative rule of thumb