mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Save dashboard: Fix jsonDiff accessing undefined values (#75065)
This commit is contained in:
parent
cc251db3c1
commit
0557a38da1
@ -28,16 +28,16 @@ export const jsonDiff = (lhs: any, rhs: any): Diffs => {
|
||||
|
||||
const path = tail(diff.path.split('/'));
|
||||
|
||||
if (diff.op === 'replace') {
|
||||
if (diff.op === 'replace' && rhsMap.pointers[diff.path]) {
|
||||
originalValue = get(lhs, path);
|
||||
value = diff.value;
|
||||
startLineNumber = rhsMap.pointers[diff.path].value.line;
|
||||
}
|
||||
if (diff.op === 'add') {
|
||||
if (diff.op === 'add' && rhsMap.pointers[diff.path]) {
|
||||
value = diff.value;
|
||||
startLineNumber = rhsMap.pointers[diff.path].value.line;
|
||||
}
|
||||
if (diff.op === 'remove') {
|
||||
if (diff.op === 'remove' && lhsMap.pointers[diff.path]) {
|
||||
originalValue = get(lhs, path);
|
||||
startLineNumber = lhsMap.pointers[diff.path].value.line;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user