[android] Do not crash on unknown types

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-10-19 12:27:20 +02:00
parent 96d51dfcf9
commit 89bcc9894d

View File

@@ -88,7 +88,7 @@ public class Metadata implements Parcelable
if (type.mMetaType == metaType)
return type;
throw new IllegalArgumentException("Illegal metaType: " + metaType);
return -1;
}
public int toInt()
@@ -102,6 +102,9 @@ public class Metadata implements Parcelable
public void addMetadata(int metaType, String metaValue)
{
final MetadataType type = MetadataType.fromInt(metaType);
if (type == -1)
return;
mMetadataMap.put(type, metaValue);
}