I think it's ok if it returns null, it just won't display the file extension in that case.