mirror of
https://github.com/writefreely/writefreely
synced 2025-02-26 03:37:11 +00:00
Fall back to default template on bad editor config
Ref T677
This commit is contained in:
parent
f6a7dfacb9
commit
603a52dc46
1 changed files with 4 additions and 0 deletions
4
pad.go
4
pad.go
|
@ -60,6 +60,10 @@ func handleViewPad(app *App, w http.ResponseWriter, r *http.Request) error {
|
||||||
|
|
||||||
if action == "" && slug == "" {
|
if action == "" && slug == "" {
|
||||||
// Not editing any post; simply render the Pad
|
// Not editing any post; simply render the Pad
|
||||||
|
if templates[padTmpl] == nil {
|
||||||
|
log.Info("No template '%s' found. Falling back to default 'pad' template.", padTmpl)
|
||||||
|
padTmpl = "pad"
|
||||||
|
}
|
||||||
if err = templates[padTmpl].ExecuteTemplate(w, "pad", appData); err != nil {
|
if err = templates[padTmpl].ExecuteTemplate(w, "pad", appData); err != nil {
|
||||||
log.Error("Unable to execute template: %v", err)
|
log.Error("Unable to execute template: %v", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue