commit 675d5829bbff15d43c6281908f9e5a8dbedac4c2
parent 892d3e58d64004b715b11c719533ebcffca94fee
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 3 Apr 2018 18:37:31 +0200
Make sure we atleast return the empty paper Data if DB fails
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api/webserver.go b/api/webserver.go
@@ -225,6 +225,7 @@ func getPapers(full bool, uuid string) ([]byte, error) {
}
var papers []Paper
+ paper := Paper{}
papersDB.View(func(txn *badger.Txn) error {
opts := badger.DefaultIteratorOptions
@@ -251,7 +252,6 @@ func getPapers(full bool, uuid string) ([]byte, error) {
stringKeyEnd = stringKeySlice[len(stringKeySlice)-2]
}
- paper := Paper{}
if known[stringKeyEnd] {
continue
}