{"record":{"id":"637ca3fc93b9ccce","repo":"microg/GmsCore","slug":"url-cannot-be-null","errorCode":null,"errorMessage":"url cannot be null","messagePattern":"url cannot be null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"play-services-base/src/main/java/com/google/android/gms/common/images/WebImage.java","lineNumber":63,"sourceCode":"     * Constructs a new {@link WebImage} with the given URL.\n     *\n     * @param url The URL of the image.\n     * @throws IllegalArgumentException If the URL is null or empty.\n     */\n    public WebImage(Uri url) {\n        this(url, 0, 0);\n    }\n\n    /**\n     * Constructs a new {@link WebImage} with the given URL and dimensions.\n     *\n     * @param url    The URL of the image.\n     * @param width  The width of the image, in pixels.\n     * @param height The height of the image, in pixels.\n     * @throws IllegalArgumentException If the URL is null or empty, or the dimensions are invalid.\n     */\n    public WebImage(Uri url, int width, int height) {\n        if (url == null) throw new IllegalArgumentException(\"url cannot be null\");\n        if (width < 0 || height < 0) throw new IllegalArgumentException(\"width and height must not be negative\");\n        this.url = url;\n        this.width = width;\n        this.height = height;\n    }\n\n    /**\n     * Gets the image height, in pixels.\n     */\n    public int getHeight() {\n        return height;\n    }\n\n    /**\n     * Gets the image URL.\n     */\n    public Uri getUrl() {\n        return url;","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-base/src/main/java/com/google/android/gms/common/images/WebImage.java#L45-L81","documentation":"Constructor validation in WebImage: the provided Uri is null (or empty in the full constructor), so no image reference can be constructed. The URL argument is the input at fault, matching the documented @throws IllegalArgumentException.","triggerScenarios":"Thrown at play-services-base/src/main/java/com/google/android/gms/common/images/WebImage.java:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Uri for null/emptiness before constructing a WebImage","Skip or reject profile data entries that carry no image URL"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"157c9d86ac46c195a86c2f15ab55c84036223f95","analyzedAt":"2026-09-06T17:27:33.892Z","contentChangedAt":"2026-09-06T17:27:33.892Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}