diff options
| author | Gavin Andresen <[email protected]> | 2013-01-30 15:07:00 -0500 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-01-30 15:24:37 -0500 |
| commit | 85b534b23eb2c39fc97a4c5e9de6f61580bb61b1 (patch) | |
| tree | b5fe1d8878420f563995a7b3f1d64ad6ee37bd96 /src/qt/clientmodel.cpp | |
| parent | Correctly randomize change output position (diff) | |
| download | discoin-85b534b23eb2c39fc97a4c5e9de6f61580bb61b1.tar.xz discoin-85b534b23eb2c39fc97a4c5e9de6f61580bb61b1.zip | |
Prevent Qt crash at startup with an empty data directory
Diffstat (limited to 'src/qt/clientmodel.cpp')
| -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 12bd98933..084ad12a5 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() |