aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-01-30 15:07:00 -0500
committerGavin Andresen <gavinandresen@gmail.com>2013-01-30 15:24:37 -0500
commit85b534b23eb2c39fc97a4c5e9de6f61580bb61b1 (patch)
treeb5fe1d8878420f563995a7b3f1d64ad6ee37bd96
parentac7b8ea0864e925b0f5cf487be9acdf4a5d0c487 (diff)
Prevent Qt crash at startup with an empty data directory
-rw-r--r--src/qt/clientmodel.cpp5
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()