mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix nil pointer dereference (#13221)
This commit is contained in:
parent
2936e34d75
commit
28250271cc
@ -466,6 +466,9 @@ func (e *CloudWatchExecutor) handleGetEc2InstanceAttribute(ctx context.Context,
|
|||||||
return nil, errors.New("invalid attribute path")
|
return nil, errors.New("invalid attribute path")
|
||||||
}
|
}
|
||||||
v = v.FieldByName(key)
|
v = v.FieldByName(key)
|
||||||
|
if !v.IsValid() {
|
||||||
|
return nil, errors.New("invalid attribute path")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if attr, ok := v.Interface().(*string); ok {
|
if attr, ok := v.Interface().(*string); ok {
|
||||||
data = *attr
|
data = *attr
|
||||||
|
Loading…
Reference in New Issue
Block a user