Fixed issue with getExtension to something that is null