diff --git a/src/addressbook.cpp b/src/addressbook.cpp index 245fa6a..3ea68dd 100644 --- a/src/addressbook.cpp +++ b/src/addressbook.cpp @@ -181,6 +181,10 @@ QList> AddressBook::readFromStorage() { QList> labels; + if (!file.exists()) { + return labels; + } + file.open(QIODevice::ReadOnly); QDataStream in(&file); // read the data serialized from the file QString version; @@ -212,4 +216,4 @@ QString AddressBook::writeableFile() { } else { return dir.filePath(filename); } -} \ No newline at end of file +}