From 2c9a8a33a4152f04db4455acdaebe1d268083182 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Sun, 20 Oct 2024 12:34:12 -0400 Subject: [PATCH] fix error when reading an empty location marker file --- scwx-qt/source/scwx/qt/model/marker_model.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scwx-qt/source/scwx/qt/model/marker_model.cpp b/scwx-qt/source/scwx/qt/model/marker_model.cpp index eb3e8bee..8bcd93fa 100644 --- a/scwx-qt/source/scwx/qt/model/marker_model.cpp +++ b/scwx-qt/source/scwx/qt/model/marker_model.cpp @@ -254,6 +254,10 @@ bool MarkerModel::setData(const QModelIndex& index, void MarkerModel::HandleMarkersInitialized(size_t count) { + if (count == 0) + { + return; + } const int index = static_cast(count - 1); beginInsertRows(QModelIndex(), 0, index);