if err == nil {
if len(core_pattern) > 0 && core_pattern[0] != '|' {
index := strings.LastIndex(core_pattern, "/")
- core_pattern = core_pattern[:index]
- volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
+ if index == -1 {
+ c.Suite.Log("'core_pattern' isn't set to an absolute path. Core dump check will not work.")
+ } else {
+ core_pattern = core_pattern[:index]
+ volumeSlice = append(volumeSlice, c.Suite.getLogDirPath()+":"+core_pattern)
+ }
} else {
c.Suite.Log(fmt.Sprintf("core_pattern \"%s\" starts with pipe, ignoring", core_pattern))
}