diff options
Diffstat (limited to 'engines/sword1/resman.cpp')
-rw-r--r-- | engines/sword1/resman.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index 41f952c3f4..2bad8a79a7 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -36,7 +36,7 @@ #include "sword1/swordres.h" #include "gui/message.h" -#include "gui/GuiManager.h" +#include "gui/gui-manager.h" namespace Sword1 { void guiFatalError(char *msg) { @@ -332,10 +332,13 @@ Common::File *ResMan::resFile(uint32 id) { Clu *closeClu = _openCluStart; _openCluStart = _openCluStart->nextOpen; - closeClu->file->close(); - delete closeClu->file; - closeClu->file = NULL; - closeClu->nextOpen = NULL; + if (closeClu) { + if (closeClu->file) + closeClu->file->close(); + delete closeClu->file; + closeClu->file = NULL; + closeClu->nextOpen = NULL; + } _openClus--; } } |