Browse Source

Check for nil file merge

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
Vadim Markovtsev 6 years ago
parent
commit
054838ac1a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      internal/burndown/file.go

+ 3 - 0
internal/burndown/file.go

@@ -240,6 +240,9 @@ func (file *File) Update(time int, pos int, insLength int, delLength int) {
 func (file *File) Merge(day int, others... *File) bool {
 func (file *File) Merge(day int, others... *File) bool {
 	dirty := false
 	dirty := false
 	for _, other := range others {
 	for _, other := range others {
+		if other == nil {
+			panic("merging File with nil")
+		}
 		if file.Hash != other.Hash {
 		if file.Hash != other.Hash {
 			dirty = true
 			dirty = true
 			break
 			break