Update snapshot.go

avoid a panic on a too short slice.
pull/8329/head
Adrien Delorme 6 years ago
parent 7108f6d07e
commit 116a038de9

@ -35,7 +35,7 @@ func ParseSnapshotData(snapshotData string) (*VBoxSnapshot, error) {
node.IsCurrent = true
} else {
matches := SnapshotNamePartsRe.FindStringSubmatch(txt)
if matches[1] == "Name" {
if len(matches) >= 2 && matches[1] == "Name" {
if nil == rootNode {
node = new(VBoxSnapshot)
rootNode = node

Loading…
Cancel
Save