#vulnerable code 
                             @Override
	public ReadableContentPage getContentPage(String code, MerchantStore store, Language language) {

		Validate.notNull(code, "Content code cannot be null");
		Validate.notNull(store, "MerchantStore cannot be null");

		try {
			Content content = null;
			
			if(language == null) {
				Optional.ofNullable(contentService.getByCode(code, store))
				.orElseThrow(() -> new ResourceNotFoundException("No page found : " + code));
			} else {
				Optional.ofNullable(contentService.getByCode(code, store, language))
				.orElseThrow(() -> new ResourceNotFoundException("No page found : " + code));
			}

			return convertContentToReadableContentPage(store, language, content);

		} catch (ServiceException e) {
			throw new ServiceRuntimeException("Error while getting page " + e.getMessage(), e);
		}
	} 
                            #location 18 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             @Override
	public ReadableContentPage getContentPage(String code, MerchantStore store, Language language) {

		Validate.notNull(code, "Content code cannot be null");
		Validate.notNull(store, "MerchantStore cannot be null");

		try {
			Content content = null;
			
			if(language == null) {
				content = Optional.ofNullable(contentService.getByCode(code, store))
				.orElseThrow(() -> new ResourceNotFoundException("No page found : " + code));
			} else {
				content = Optional.ofNullable(contentService.getByCode(code, store, language))
				.orElseThrow(() -> new ResourceNotFoundException("No page found : " + code));
			}

			return convertContentToReadableContentPage(store, language, content);

		} catch (ServiceException e) {
			throw new ServiceRuntimeException("Error while getting page " + e.getMessage(), e);
		}
	}