mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +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)
|
if (type.mMetaType == metaType)
|
||||||
return type;
|
return type;
|
||||||
|
|
||||||
throw new IllegalArgumentException("Illegal metaType: " + metaType);
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int toInt()
|
public int toInt()
|
||||||
@@ -102,6 +102,9 @@ public class Metadata implements Parcelable
|
|||||||
public void addMetadata(int metaType, String metaValue)
|
public void addMetadata(int metaType, String metaValue)
|
||||||
{
|
{
|
||||||
final MetadataType type = MetadataType.fromInt(metaType);
|
final MetadataType type = MetadataType.fromInt(metaType);
|
||||||
|
if (type == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
mMetadataMap.put(type, metaValue);
|
mMetadataMap.put(type, metaValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user