Skip to content

Add a null check to method TestUtils.compressHeapDumps.#10053

Merged
normanmaurer merged 1 commit intonetty:4.1from
seedeed:bugfix
Feb 25, 2020
Merged

Add a null check to method TestUtils.compressHeapDumps.#10053
normanmaurer merged 1 commit intonetty:4.1from
seedeed:bugfix

Conversation

@seedeed
Copy link
Copy Markdown
Contributor

@seedeed seedeed commented Feb 22, 2020

Motivation:

java.io.File.listFiles() may return null and cause a unexpected NPE.

Modification:

Add a null check for variable files. And if variable files is null, the compressHeapDumps method will just return after logging a error message.

Result:

Fix the potential NPE.

@netty-bot
Copy link
Copy Markdown

Can one of the admins verify this patch?

@normanmaurer
Copy link
Copy Markdown
Member

@netty-bot test this please

@normanmaurer normanmaurer added this to the 4.1.46.Final milestone Feb 25, 2020
@normanmaurer normanmaurer merged commit 6d09298 into netty:4.1 Feb 25, 2020
normanmaurer pushed a commit that referenced this pull request Feb 25, 2020
Motivation:

java.io.File.listFiles() may return null and cause a unexpected NPE.

Modification:

Add a null check for variable files. And if variable files is null, the compressHeapDumps method will just return after logging a error message.

Result:

Fix the potential NPE.
ihanyong pushed a commit to ihanyong/netty that referenced this pull request Jul 31, 2020
Motivation:

java.io.File.listFiles() may return null and cause a unexpected NPE.

Modification:

Add a null check for variable files. And if variable files is null, the compressHeapDumps method will just return after logging a error message.

Result:

Fix the potential NPE.
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.

3 participants