From 8b751316b4657707499ded35988f5ff53b423fe5 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 22 Dec 2024 05:18:59 +0200 Subject: Do the checks right --- src/js/arching-kaos-file-system.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/js') diff --git a/src/js/arching-kaos-file-system.js b/src/js/arching-kaos-file-system.js index c629ce4..3c66cc2 100644 --- a/src/js/arching-kaos-file-system.js +++ b/src/js/arching-kaos-file-system.js @@ -79,21 +79,21 @@ function akfsSerializeChunks(hash) { final_array_seq.push(hash); } - else + else if ( thingy.leafs[hash] !== undefined ) { - if ( thingy.leafs[hash] !== undefined ) + if ( thingy.leafs[hash].head !== undefined ) { - console.log(`The following hash is failing: ${hash}`) - if ( thingy.leafs[hash].head !== undefined ) - { - akfsSerializeChunks(thingy.leafs[hash].head); - } + akfsSerializeChunks(thingy.leafs[hash].head); } if ( thingy.leafs[hash].head !== thingy.leafs[hash].tail ) { akfsSerializeChunks(thingy.leafs[hash].tail); } } + else + { + console.log(`The following hash is failing: ${hash}`) + } } function makeUpData() -- cgit v1.2.3