From dbc6dea1b27e87bca0ef496b8b74d6f027bb7de3 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 24 May 2013 15:52:52 -0400 Subject: [PATCH] Fix crash-at-shutdown if exiting before initializing wallet --- src/init.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index ebd9dee7b..59bf32eca 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -100,7 +100,8 @@ void Shutdown() StopNode(); { LOCK(cs_main); - pwalletMain->SetBestChain(CBlockLocator(pindexBest)); + if (pwalletMain) + pwalletMain->SetBestChain(CBlockLocator(pindexBest)); if (pblocktree) pblocktree->Flush(); if (pcoinsTip)