Skip to content

Commit 1772050

Browse files
icbakercopybara-github
authored andcommitted
Remove confusing null from ParserException.getMessage()
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
1 parent 382f306 commit 1772050

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/common/src/main/java/androidx/media3/common/ParserException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ protected ParserException(
109109
this.dataType = dataType;
110110
}
111111

112-
@Nullable
113112
@Override
114113
public String getMessage() {
115-
return super.getMessage()
116-
+ " {contentIsMalformed="
114+
String superMessage = super.getMessage();
115+
return (superMessage != null ? superMessage + " " : "")
116+
+ "{contentIsMalformed="
117117
+ contentIsMalformed
118118
+ ", dataType="
119119
+ dataType

0 commit comments

Comments
 (0)