Avoid panic when stripping empty string

Signed-off-by: Darren Shepherd <darren@rancher.com>
This commit is contained in:
Darren Shepherd 2015-05-02 23:20:20 -07:00
parent 70cc567c46
commit 7013b45dde
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ type OsRelease struct {
}
func stripQuotes(val string) string {
if val[0] == '"' {
if len(val) > 0 && val[0] == '"' {
return val[1 : len(val)-1]
}
return val