diff --git a/Utilities/WaveFrontReader.h b/Utilities/WaveFrontReader.h index 99fb5ec..26e29d7 100644 --- a/Utilities/WaveFrontReader.h +++ b/Utilities/WaveFrontReader.h @@ -589,13 +589,13 @@ namespace DX HRESULT LoadVBO(_In_z_ const wchar_t* szFileName) { + Clear(); + if (!szFileName) return E_INVALIDARG; using namespace DirectX; - Clear(); - #ifdef _WIN32 wchar_t fname[_MAX_FNAME] = {}; _wsplitpath_s(szFileName, nullptr, 0, nullptr, 0, fname, _MAX_FNAME, nullptr, 0);