[Core] Fix crash when deleting solution folder

Fixes bug #20548 - NullReferenceException when deleting a solution folder