From 25640faaebaad1a8f9c988e7ed4acb55acd5f21c Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 9 Jun 2014 16:43:01 -0700 Subject: [PATCH] fix(util/trie): bug in for_each method Signed-off-by: Leonardo de Moura --- src/util/trie.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/util/trie.h b/src/util/trie.h index 9ed877020..c0d2d1519 100644 --- a/src/util/trie.h +++ b/src/util/trie.h @@ -139,8 +139,10 @@ public: template void for_each(F && f) const { - buffer prefix; - for_each(f, *this, prefix); + if (m_ptr) { + buffer prefix; + for_each(f, *this, prefix); + } } // for debugging purposes