Skip to content

Commit

Permalink
Protect against undefineds in get links
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Aug 5, 2024
1 parent 6f307a6 commit f9f2b77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/signals/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@holochain-open-dev/signals",
"version": "0.300.6",
"version": "0.300.7",
"description": "Holochain async-signals to build reusable holochain-open-dev modules",
"author": "[email protected]",
"main": "dist/index.js",
Expand Down
12 changes: 6 additions & 6 deletions packages/signals/src/holochain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export function collectionSignal<

const maybeSet = (newLinksValue: Link[]) => {
if (!active) return;
const orderedNewLinks = uniquifyLinks(newLinksValue).sort(
sortLinksByTimestampAscending,
);
const orderedNewLinks = uniquifyLinks(
newLinksValue ? newLinksValue : [],
).sort(sortLinksByTimestampAscending);
if (
!links ||
!areArrayHashesEqual(
Expand Down Expand Up @@ -595,9 +595,9 @@ export function liveLinksSignal<

const maybeSet = (newLinksValue: Link[]) => {
if (!active) return;
const orderedNewLinks = uniquifyLinks(newLinksValue).sort(
sortLinksByTimestampAscending,
);
const orderedNewLinks = uniquifyLinks(
newLinksValue ? newLinksValue : [],
).sort(sortLinksByTimestampAscending);

if (
!links ||
Expand Down

0 comments on commit f9f2b77

Please sign in to comment.