Fix path checking in Build.getCustomBuildDir
What does this MR do?
Fixes the path checking logic in Build.getCustomBuildDir
Why was this MR needed?
See #26485 (closed)
What's the best way to test this MR?
See steps in #26485 (closed)
What are the relevant issue numbers?
Closes #26485 (closed)