UE4Editor crash when opening new project on Linux

After building the master branch on Linux Mint, I tried to create a brand new FPS project through the launcher using the FPS template project. The project was created successfully but the UE4Editor crashed trying to load it. I debugged the problem and traced it down to a bad line of code in the Runtime/Core/Private/Linux/LinuxPlatformFile.cpp MapCaseInsensitiveFile function. Apparently this function can get called with an empty string for the PossiblyWrongFilename argument and when this happens, the UE4Editor errors out(SEGV). The reason for the crash is the line of code that tries to get the first element of the PossiblyWrongFilename argument variable without first checking that the string is not empty.
if (PossiblyWrongFilename[0] != TEXT(’/’))

My fix was to check for the empty string as well and also return false
if (PossiblyWrongFilename.IsEmpty() || (PossiblyWrongFilename[0] != TEXT(’/’)))

After making this change the new project loads without a problem
fix.diff.zip

master revision is 42333de1d92909e5686b02fa07a666b7a2fbca1b

Hey CodeTackler-

Thanks for lettings us know and I’m glad you were able to find a fix easily. The fix you suggest would actually make a great pull request to be added to the engine source. You can create a pull request on GitHub (www.github.com) and it will be reviewed for inclusion.

Cheers

Created a pull request with the same title as this bug.

CodeTackler