diff --git a/AddressBook.cpp b/AddressBook.cpp index 754d314a..43612506 100644 --- a/AddressBook.cpp +++ b/AddressBook.cpp @@ -161,6 +161,11 @@ namespace client int AddressBookFilesystemStorage::Save (const std::map& addresses) { + if (addresses.size() == 0) { + LogPrint(eLogWarning, "Addressbook: not saving empty addressbook"); + return 0; + } + int num = 0; auto filename = GetPath () / "addresses.csv"; std::ofstream f (filename.string (), std::ofstream::out); // in text mode