fixed minor error when query and path is null

This commit is contained in:
heyethereum
2024-08-07 23:20:32 +08:00
parent b55c615ed5
commit 4856417cf0

View File

@@ -105,13 +105,13 @@ public class URLEntity {
// Custom getter for path // Custom getter for path
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public String getPath() { public String getPath() {
return path.isEmpty() ? null : path; return path == null || path.isEmpty() ? null : path;
} }
// Custom getter for query // Custom getter for query
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty @JsonProperty
public String getQuery() { public String getQuery() {
return query.equals("{}") ? null : query; return query == null || query.equals("{}") ? null : query;
} }
} }