Skip to content

Commit 22ff7c7

Browse files
committed
fix: handle None node in list helpers
1 parent 126ce98 commit 22ff7c7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Sprint-2/implement_lru_cache/lru_cache.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ def __init__(self, limit):
1313
self.cache = {}
1414

1515
def add_to_head(self, node):
16+
if node == None:
17+
return
1618
if self.head is None:
1719
self.head = node
1820
self.tail = node

0 commit comments

Comments
 (0)