From e0f7c9949651494b3791ee926b93d98146c61e1a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 12 Mar 2018 11:00:40 +0200 Subject: [PATCH] Fixed crash on loading directories --- src/w_wad.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/w_wad.cpp b/src/w_wad.cpp index fc6121b73..18bf2aa39 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -1363,7 +1363,10 @@ FileReader *FWadCollection::GetFileReader(int wadnum) { return NULL; } - return Files[wadnum]->GetReader(); + + // Return reader for real files only and nullptr otherwise + FileReader* const reader = Files[wadnum]->GetReader(); + return reader->isOpen() ? reader : nullptr; } //==========================================================================