From e85995ed0baa660addc97498e77c7d1700f2663c Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Sun, 20 Sep 2015 10:16:47 -0700 Subject: [PATCH] Fix #28 Help following the main thread without being distracted. --- CppCoreGuidelines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index dc1236d..dd69470 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2363,7 +2363,7 @@ Returning a `T*` to transfer ownership is a misuse. Node* find(Node* t, const string& s) // find s in a binary tree of Nodes { - if (t->name==s) return t; + if (t == nullptr || t->name == s) return t; if (auto p = find(t->left,s)) return p; if (auto p = find(t->right,s)) return p; return nullptr;