commit 62752cfee93160a684da00627405c74a08c3344f
parent 4d708f096d5df64bf7309cbed67564d98c8e815a
Author: bep <bjorn.erik.pedersen@gmail.com>
Date: Wed, 18 Feb 2015 22:16:40 +0100
Return unmodified content if panic in LiveReloadInject
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/transform/livereloadinject.go b/transform/livereloadinject.go
@@ -6,10 +6,11 @@ import (
"github.com/spf13/viper"
)
-func LiveReloadInject(content []byte) []byte {
+func LiveReloadInject(content []byte) (injected []byte) {
defer func() {
if r := recover(); r != nil {
jww.ERROR.Println("Recovered in LiveReloadInject", r)
+ injected = content
}
}()
match := []byte("</body>")