From 69caf3cf709d1a5bf1339c05c348de13e338cdd7 Mon Sep 17 00:00:00 2001 From: Bachir Bendrissou Date: Sun, 28 May 2023 11:39:25 +0100 Subject: [PATCH] Fix a TypeError When running LangFuzzer2 fuzzer, there is a crash. The cause is the encounter of an unexpected NoneType object. Importantly, node's Children are checked against None, and not the node itself. --- docs/code/LangFuzzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/code/LangFuzzer.py b/docs/code/LangFuzzer.py index b735a25f4..bbede4288 100755 --- a/docs/code/LangFuzzer.py +++ b/docs/code/LangFuzzer.py @@ -427,7 +427,7 @@ def generate_new_tree(self, node, choice): if self.check_diversity(pool): return random.choice(self.fragments[name]) else: - return None + return (name, None) else: return (name, [self.generate_new_tree(c, choice) for c in children])