From 3f8a69b4ad8ea949b753c3598912b917e791b62c Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 26 Aug 2013 00:14:02 +0200 Subject: [PATCH] Don't crash when trying to delete a reference that doesn't exist anymore --- apps/openmw/mwworld/cellstore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 8bb3d3c8d1..0c145ab600 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -43,7 +43,8 @@ namespace MWWorld // Skip this when reference was deleted. // TODO: Support respawning references, in this case, we need to track it somehow. if (ref.mDeleted) { - mList.erase(iter); + if (iter != mList.end()) + mList.erase(iter); return; }