Skip to content

Commit 9054d3c

Browse files
committed
Resolve the null and stop executing code after that
1 parent 6afedd1 commit 9054d3c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/hnapi.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ var api = {
143143
var item = hn.child('item/' + id);
144144
item.once('value', function(snap){
145145
var val = snap.val();
146-
if (!val) resolve(); // Silently resolve with nothing if null
146+
if (!val){ // Silently resolve with nothing if null
147+
resolve();
148+
return;
149+
}
147150

148151
// Comments
149152
var kidsPromises = Promise.resolve();

0 commit comments

Comments
 (0)