Skip to content

Commit

Permalink
Merge pull request #21 from kitconcept/fixedgecaseinadapter
Browse files Browse the repository at this point in the history
Fix edge case in adapter when the object is null or undefined
  • Loading branch information
sneridagh authored Apr 20, 2023
2 parents 4dce62d + 5ca90fa commit 299a880
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/21.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix edge case in adapter when the object is null or undefined @sneridagh
2 changes: 1 addition & 1 deletion src/components/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const SliderBlockDataAdapter = ({
[id]: value,
};

if (id === 'slides') {
if (id === 'slides' && data[id]) {
const diff = difference(value, data[id]);
// If we are moving two items in the array, the changeset is > 1
// then we do not do any sync
Expand Down

0 comments on commit 299a880

Please sign in to comment.