{"record":{"id":"24111af0e54b8282","repo":"microg/GmsCore","slug":"string-must-not-be-null","errorCode":null,"errorMessage":"string must not be null","messagePattern":"string must not be null","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"play-services-base/src/main/java/com/google/android/gms/common/images/Size.java","lineNumber":92,"sourceCode":"        return result;\n    }\n\n    /**\n     * Parses the specified string as a size value.\n     * <p>\n     * The ASCII characters {@code \\}{@code u002a} ('*') and {@code \\}{@code u0078} ('x') are recognized as separators between the width and height.\n     * <p>\n     * For any {@code Size s}: {@code Size.parseSize(s.toString()).equals(s)}. However, the method also handles sizes expressed in the following forms:\n     * <p>\n     * \"width{@code x}height\" or \"width{@code *}height\" => new Size(width, height), where width and height are string integers potentially containing a sign, such as \"-10\", \"+7\" or \"5\".\n     *\n     * @param string the string representation of a size value.\n     * @return the size value represented by {@code string}.\n     * @throws NumberFormatException if {@code string} cannot be parsed as a size value.\n     * @throws NullPointerException  if {@code string} was null\n     */\n    public static Size parseSize(String string) {\n        if (string == null) throw new NullPointerException(\"string must not be null\");\n        int split = string.indexOf('*');\n        if (split < 0) split = string.indexOf('x');\n        if (split < 0) throw new NumberFormatException(\"Invalid Size: \\\"\" + string + \"\\\"\");\n        return new Size(Integer.parseInt(string.substring(0, split)), Integer.parseInt(string.substring(split + 1)));\n    }\n\n    /**\n     * Return the size represented as a string with the format {@code \"WxH\"}\n     * @return string representation of the size\n     */\n    @Override\n    public String toString() {\n        return width + \"x\" + height;\n    }\n}\n","sourceCodeStart":74,"sourceCodeEnd":108,"githubUrl":"https://github.com/microg/GmsCore/blob/157c9d86ac46c195a86c2f15ab55c84036223f95/play-services-base/src/main/java/com/google/android/gms/common/images/Size.java#L74-L108","documentation":"Size.parseSize(String) requires a non-null input string formatted as 'WxH' or 'W*H'; it throws NullPointerException when the argument is null before parsing can begin. The faulting input is a null string passed to parseSize.","triggerScenarios":"Thrown at play-services-base/src/main/java/com/google/android/gms/common/images/Size.java:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the input string for null before calling parseSize","Skip parsing or return a default Size when the source string is null"],"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"}