Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Null Pointer Exception when User Defined Type is not found. #1084

Closed
boutier opened this issue Jan 27, 2021 · 1 comment
Closed

Null Pointer Exception when User Defined Type is not found. #1084

boutier opened this issue Jan 27, 2021 · 1 comment
Labels
type: bug A general bug

Comments

@boutier
Copy link
Contributor

boutier commented Jan 27, 2021

In the following, copy() should not be called when resolveType() fails.

com.datastax.oss.driver.api.core.type.UserDefinedType userType = userTypeResolver.resolveType(identifier)
.copy(frozen);
if (userType == null) {

		com.datastax.oss.driver.api.core.type.UserDefinedType userType = userTypeResolver.resolveType(identifier)
-				.copy(frozen);

		if (userType == null) {
			throw new MappingException(String.format("User type [%s] not found", identifier));
		}

-		return userType;
+		return userType.copy(frozen);
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 27, 2021
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 28, 2021
@mp911de
Copy link
Member

mp911de commented Jan 28, 2021

That's clearly a bug. Care to submit a pull request?

@mp911de mp911de added this to the 3.0.7 (Neumann SR7) milestone Jan 29, 2021
mp911de pushed a commit that referenced this issue Jan 29, 2021
mp911de added a commit that referenced this issue Jan 29, 2021
Replace duplicated code with method calls.

Closes: #1084
Original pull request: #1085
Related ticket: DATACASS-465
mp911de pushed a commit that referenced this issue Jan 29, 2021
mp911de added a commit that referenced this issue Jan 29, 2021
Replace duplicated code with method calls.

Closes: #1084
Original pull request: #1085
Related ticket: DATACASS-465
mp911de added a commit that referenced this issue Jan 29, 2021
Replace duplicated code with method calls.

Closes: #1084
Original pull request: #1085
Related ticket: DATACASS-465
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants