Skip to content

Fix a null pointer exception in MDLV2000Reader#1254

Merged
egonw merged 4 commits intocdk:mainfrom
Mailaender:mdlv2000-npe
Jan 13, 2026
Merged

Fix a null pointer exception in MDLV2000Reader#1254
egonw merged 4 commits intocdk:mainfrom
Mailaender:mdlv2000-npe

Conversation

@Mailaender
Copy link
Copy Markdown
Contributor

Closes #1253

@egonw
Copy link
Copy Markdown
Member

egonw commented Jan 13, 2026

Looks good to me.

That said, I think this code can be further optimized:

} else if (element.equals("R") || (!element.isEmpty() && element.charAt(0) == 'R')) {

I think we only have to ask if R is the first char, not? That's the case if the element is exactly "R" too.

@johnmay, okay with the PR too?

@johnmay
Copy link
Copy Markdown
Member

johnmay commented Jan 13, 2026

@egonw startsWith is correct as it can be 'R', 'R#' or 'R1', 'R2' etc.

Patch looks good to merge

@egonw egonw merged commit edc65f2 into cdk:main Jan 13, 2026
7 of 8 checks passed
@Mailaender Mailaender deleted the mdlv2000-npe branch January 13, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in MDLV2000Reader

3 participants