Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Table.cpp
diff options
context:
space:
mode:
1 files changed, 3 insertions, 1 deletions
-rw-r--r--src/Models/Table.cpp4
diff --git a/src/Models/Table.cpp b/src/Models/Table.cpp
index 04fb7b7..892a05d 100644
--- a/src/Models/Table.cpp
+++ b/src/Models/Table.cpp
@@ -153,9 +153,11 @@ void Table::saveToFile(const char* filePath) const {
std::ofstream outFile(filePath);
if (!outFile.is_open())
throw std::logic_error("Could not open file!");
+
for (unsigned i = 0; i < cells.get_count(); i++) {
for (unsigned j = 0; j < cells.get_count(); j++) {
- cells[i][j]->writeToFile(outFile);
+ if (cells[i][j] != nullptr)
+ cells[i][j]->writeToFile(outFile);
outFile << ',';
}
outFile << '\n';