aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/db.go b/db.go
index a37f687..d15dc74 100644
--- a/db.go
+++ b/db.go
@@ -577,7 +577,11 @@ type Stats struct {
func (s *Stats) Sub(other *Stats) Stats {
var diff Stats
if s == nil {
- return diff
+ if other == nil {
+ return diff
+ } else {
+ return *other
+ }
}
diff = *s
if other == nil {