mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
storage: Avoid panic when no previous versions in history (#88880)
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
parent
003e3efce9
commit
c931a44503
@ -1095,6 +1095,11 @@ func (s *sqlEntityServer) poll(since int64, out chan *entity.EntityWatchResponse
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(history.Versions) == 0 {
|
||||||
|
ctxLogger.Error("error reading previous entity", "guid", updated.Guid, "err", "no previous version found")
|
||||||
|
return errors.New("no previous version found")
|
||||||
|
}
|
||||||
|
|
||||||
result.Previous = history.Versions[0]
|
result.Previous = history.Versions[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user