diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-01-30 14:37:15 -0800 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-01-30 14:37:15 -0800 |
commit | 4dfae2fd2f07e19430ca057d4b367ce7f6c7fd0c (patch) | |
tree | 0af5ebce2759929f8d4c71f1b8198bddc7913d3a | |
parent | cb2e1bdaa902197ba0f04aebd00420a4680548e0 (diff) | |
parent | 85b534b23eb2c39fc97a4c5e9de6f61580bb61b1 (diff) | |
download | bitcoin-4dfae2fd2f07e19430ca057d4b367ce7f6c7fd0c.tar.xz |
Merge pull request #2248 from gavinandresen/issue2239
Prevent Qt crash at startup with an empty data directory
-rw-r--r-- | src/qt/clientmodel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 12bd989338..084ad12a56 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -48,7 +48,10 @@ int ClientModel::getNumBlocksAtStartup() QDateTime ClientModel::getLastBlockDate() const { - return QDateTime::fromTime_t(pindexBest->GetBlockTime()); + if (pindexBest) + return QDateTime::fromTime_t(pindexBest->GetBlockTime()); + else + return QDateTime::fromTime_t(1231006505); // Genesis block's time } void ClientModel::updateTimer() |