From 2888975eab470be12273db8aae5778c9bc977659 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Wed, 18 Mar 2020 23:18:32 +0100 Subject: [PATCH] Treelib fix --- seminar/treelib.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seminar/treelib.py b/seminar/treelib.py index 709e6d98..8ad33c9c 100644 --- a/seminar/treelib.py +++ b/seminar/treelib.py @@ -19,6 +19,8 @@ def safe_pred(node): return None def first_brother(node): + if node is None: + return None brother = node while safe_pred(brother) is not None: brother = safe_pred(brother)