Do not assume pre-built particle will contain identifier, fixes #1269

This commit is contained in:
PikaMug 2020-04-29 02:24:46 -04:00
parent bca22f2440
commit c8d4301ba5

View File

@ -89,6 +89,10 @@ public enum PreBuiltParticle {
* @return the PreBuiltParticle represented by the specified identifier
*/
public static PreBuiltParticle fromIdentifier(String identifier) {
return valueOf(identifier);
try {
return valueOf(identifier);
} catch (IllegalArgumentException e) {
return null;
}
}
}