From 44a65512e8f9212bcb4339d82a2ddcad5198891b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 26 May 2023 10:23:58 +0000 Subject: [PATCH] Replace another assert with a throw --- components/esm4/loadcell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esm4/loadcell.cpp b/components/esm4/loadcell.cpp index 21f50ff9d9..c236a90320 100644 --- a/components/esm4/loadcell.cpp +++ b/components/esm4/loadcell.cpp @@ -30,7 +30,6 @@ #undef NDEBUG #endif -#include #include // FLT_MAX for gcc #include // FIXME: debug only #include @@ -140,7 +139,8 @@ void ESM4::Cell::load(ESM4::Reader& reader) reader.get(mCellFlags); else { - assert(subHdr.dataSize == 1 && "CELL unexpected DATA flag size"); + if (subHdr.dataSize != 1) + throw std::runtime_error("CELL unexpected DATA flag size"); reader.get(&mCellFlags, sizeof(std::uint8_t)); } else