- added missing string length check.

This commit is contained in:
Christoph Oelckers 2020-02-09 18:37:24 +01:00
parent fa057282df
commit b87ee10a0a

View file

@ -58,7 +58,7 @@ int g_gameType;
void AddSearchPath(TArray<FString>& searchpaths, const char* path) void AddSearchPath(TArray<FString>& searchpaths, const char* path)
{ {
auto fpath = M_GetNormalizedPath(path); auto fpath = M_GetNormalizedPath(path);
if (fpath.Back() == '/') fpath.Truncate(fpath.Len() - 1); if (fpath.Len() > 1 && fpath.Back() == '/') fpath.Truncate(fpath.Len() - 1);
if (DirExists(fpath)) if (DirExists(fpath))
{ {
if (searchpaths.Find(fpath) == searchpaths.Size()) if (searchpaths.Find(fpath) == searchpaths.Size())