{"record":{"id":"a83df1c3a2778412","repo":"quarkusio/quarkus","slug":"param-was-null","errorCode":null,"errorMessage":"Param was null","messagePattern":"Param was null","errorType":"validation","errorClass":"java.lang.NullPointerException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/WebTargetImpl.java","lineNumber":101,"sourceCode":"        abortIfClosed();\n        return uriBuilder.clone();\n    }\n\n    public UriBuilderImpl getUriBuilderUnsafe() {\n        return (UriBuilderImpl) uriBuilder;\n    }\n\n    @Override\n    public ConfigurationImpl getConfiguration() {\n        abortIfClosed();\n        return configuration;\n    }\n\n    @Override\n    public WebTargetImpl path(String path) throws NullPointerException {\n        abortIfClosed();\n        if (path == null)\n            throw new NullPointerException(\"Param was null\");\n        UriBuilder copy = uriBuilder.clone().path(path);\n        return newInstance(client, copy, configuration);\n    }\n\n    @Override\n    public WebTargetImpl resolveTemplate(String name, Object value) throws NullPointerException {\n        abortIfClosed();\n        if (name == null)\n            throw new NullPointerException(\"Param was null\");\n        if (value == null)\n            throw new NullPointerException(\"Param was null\");\n        String val = configuration.toString(value);\n        UriBuilder copy = uriBuilder.clone().resolveTemplate(name, val);\n        WebTargetImpl target = newInstance(client, copy, configuration);\n        return target;\n    }\n\n    @Override","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/impl/WebTargetImpl.java#L83-L119","documentation":"WebTargetImpl.path(String) throws this NullPointerException when the path argument is null, per the JAX-RS WebTarget contract. The client aborts URI building early rather than producing a malformed target.","triggerScenarios":"Calling webTarget.path(null) directly, or passing a null path variable / unset configuration value into the path building chain (e.g. path(config.getPath()) where the property was missing).","commonSituations":"Optional @ConfigProperty or system property not set, yielding null; a method parameter that callers may leave null; string concatenation refactors that make a previously defaulted value null.","solutions":["Ensure the path value is non-null before calling path() (supply a default or require the config property)","Use a constant/validated base path instead of a possibly-null variable","Null-check and skip the path() call when the segment is optional"],"exampleFix":"// before\nwebTarget.path(config.getBasePath()); // getBasePath() may be null\n// after\nString basePath = config.getBasePath();\nif (basePath != null) {\n    webTarget = webTarget.path(basePath);\n}","handlingStrategy":"validation","validationCode":"Objects.requireNonNull(path, \"path must not be null before webTarget.path()\");\nwebTarget = webTarget.path(path);","typeGuard":"String safePath(String p) {\n    return p == null ? \"\" : p; // or throw earlier with a clearer message\n}","tryCatchPattern":"try {\n    target = target.path(path);\n} catch (NullPointerException e) {\n    if (\"Param was null\".equals(e.getMessage())) {\n        throw new IllegalStateException(\"Path segment was null; check configuration/parameters\", e);\n    } else throw e;\n}","preventionTips":["Null-check or default optional path segments before building the target","Make config properties non-optional (@ConfigProperty(defaultValue=...)) when used as paths","Fail fast at startup if a required path value is missing"],"tags":["rest-client-reactive","null-pointer","uri","validation"],"backgroundTag":"null-required-parameter","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}