diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index c048b305d..0cf02813d 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -560,7 +560,7 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp, const CPubKey& my #ifdef ENABLE_WALLET - LOCK2(cs_main, pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain ? &pwalletMain->cs_wallet : NULL); #else LOCK(cs_main); #endif