diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index f947d7134..fa221154a 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -526,6 +526,10 @@ namespace MWWorld */ Ptr CellStore::searchExact (unsigned int refNumIndex, unsigned int mpNum) { + // Ensure that all objects searched for have a valid reference number + if (refNumIndex == 0 && mpNum == 0) + return 0; + SearchExactVisitor searchVisitor; searchVisitor.mRefNumIndexToFind = refNumIndex; searchVisitor.mMpNumToFind = mpNum;