mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[android] Do not crash on unknown types
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user