diff options
| author | Wladimir J. van der Laan <[email protected]> | 2013-01-30 14:37:15 -0800 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2013-01-30 14:37:15 -0800 |
| commit | 4dfae2fd2f07e19430ca057d4b367ce7f6c7fd0c (patch) | |
| tree | 0af5ebce2759929f8d4c71f1b8198bddc7913d3a /src | |
| parent | Merge pull request #2244 from sipa/files (diff) | |
| parent | Prevent Qt crash at startup with an empty data directory (diff) | |
| download | discoin-4dfae2fd2f07e19430ca057d4b367ce7f6c7fd0c.tar.xz discoin-4dfae2fd2f07e19430ca057d4b367ce7f6c7fd0c.zip | |
Merge pull request #2248 from gavinandresen/issue2239
Prevent Qt crash at startup with an empty data directory
Diffstat (limited to 'src')
| -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() |