fix null handling problems in URISanitizer.