Skip to content

Commit

Permalink
Issue #11281 - fix two NPEs seen during MultiPart with DEBUG enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Jan 24, 2024
1 parent 3853628 commit f68e4c9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ public Content.Source getContentSource()

public long getLength()
{
return getContentSource().getLength();
Content.Source source = getContentSource();
if (source != null)
return source.getLength();
return -1;
}

/**
Expand Down Expand Up @@ -320,7 +323,9 @@ public void fail(Throwable t)
{
try
{
getContentSource().fail(t);
Content.Source source = getContentSource();
if (source != null)
source.fail(t);
Path path = null;
try (AutoLock ignored = lock.lock())
{
Expand Down

0 comments on commit f68e4c9

Please sign in to comment.