mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
Fix issue with json path when expected path doesn't match actual path
This commit is contained in:
parent
60e30da7e5
commit
98221626d3
@ -52,6 +52,9 @@ func extractValue(currentKey string, value interface{}) interface{} {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if value == nil || value.(map[string]interface{})[currentKey] == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
// if currentKey contains both a key and an index (i.e. data[0])
|
// if currentKey contains both a key and an index (i.e. data[0])
|
||||||
array := value.(map[string]interface{})[currentKey].([]interface{})
|
array := value.(map[string]interface{})[currentKey].([]interface{})
|
||||||
if len(array) > arrayIndex {
|
if len(array) > arrayIndex {
|
||||||
|
Loading…
Reference in New Issue
Block a user