aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kobetic <mkobetic@gmail.com>2014-06-24 17:19:50 +0000
committerMartin Kobetic <mkobetic@gmail.com>2014-06-24 17:19:50 +0000
commit8dd18bd620ab676d8bba00813f5b85267bf7e00e (patch)
treef40eccfc4c414982f7c02168043ea4c602087887
parentadd some guards for nil pointers (diff)
downloaddedo-8dd18bd620ab676d8bba00813f5b85267bf7e00e.tar.gz
dedo-8dd18bd620ab676d8bba00813f5b85267bf7e00e.tar.xz
review tweaks
-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 {