Fix FileInfo->getType errors

Fixes #7493 

cc @DeepDiver1975 @PVince81 @LukasReschke