Skip to content

Commit

Permalink
Remove confusing null from ParserException.getMessage()
Browse files Browse the repository at this point in the history
When reading quickly this suggests something 'real' was null (similar to
a `NullPointerException`), but it's actually just the message from the
superclass.

Seen in stack trace in Issue: #2074:

```
Caused by: androidx.media3.common.ParserException: null {contentIsMalformed=true, dataType=1}
```

PiperOrigin-RevId: 719240235
  • Loading branch information
icbaker authored and copybara-github committed Jan 24, 2025
1 parent 382f306 commit 1772050
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ protected ParserException(
this.dataType = dataType;
}

@Nullable
@Override
public String getMessage() {
return super.getMessage()
+ " {contentIsMalformed="
String superMessage = super.getMessage();
return (superMessage != null ? superMessage + " " : "")
+ "{contentIsMalformed="
+ contentIsMalformed
+ ", dataType="
+ dataType
Expand Down

0 comments on commit 1772050

Please sign in to comment.