#fixed code
                                public static RegistryService getInstance() {
        RegistryType registryType = null;
        try {
            registryType = RegistryType.getType(
                ConfigurationFactory.FILE_INSTANCE.getConfig(
                    ConfigurationKeys.FILE_ROOT_REGISTRY + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
                        + ConfigurationKeys.FILE_ROOT_TYPE));
        } catch (Exception exx) {
            LOGGER.error(exx.getMessage());
        }
        RegistryService registryService;
        switch (registryType) {
            case Nacos:
                registryService = NacosRegistryServiceImpl.getInstance();
                break;
            case File:
                registryService = FileRegistryServiceImpl.getInstance();
                break;
            default:
                throw new NotSupportYetException("not support register type:" + registryType);
        }
        return registryService;
    }
#vulnerable code 
                                public static RegistryService getInstance() {
        ConfigType configType = null;
        try {
            configType = ConfigType.getType(
                ConfigurationFactory.FILE_INSTANCE.getConfig(
                    ConfigurationKeys.FILE_ROOT_REGISTRY + ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR
                        + ConfigurationKeys.FILE_ROOT_TYPE));
        } catch (Exception exx) {
            LOGGER.error(exx.getMessage());
        }
        RegistryService registryService;
        switch (configType) {
            case Nacos:
                registryService = NacosRegistryServiceImpl.getInstance();
                break;
            case File:
                registryService = FileRegistryServiceImpl.getInstance();
                break;
            default:
                throw new NotSupportYetException("not support register type:" + configType);
        }
        return registryService;
    } 
                            #location 12 
                            #vulnerability type NULL_DEREFERENCE