Fix null pointer?
This commit is contained in:
parent
f702f0c740
commit
af3dab4930
1 changed files with 5 additions and 1 deletions
|
|
@ -122,8 +122,12 @@ public class CustomArtistImageUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getFileName(Artist artist) {
|
private static String getFileName(Artist artist) {
|
||||||
|
String artistName = artist.getName();
|
||||||
|
if (artistName == null)
|
||||||
|
artistName = "";
|
||||||
// replace everything that is not a letter or a number with _
|
// replace everything that is not a letter or a number with _
|
||||||
return String.format(Locale.US, "#%d#%s.jpeg", artist.getId(), artist.getName().replaceAll("[^a-zA-Z0-9]", "_"));
|
artistName = artistName.replaceAll("[^a-zA-Z0-9]", "_");
|
||||||
|
return String.format(Locale.US, "#%d#%s.jpeg", artist.getId(), artistName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getFile(Artist artist) {
|
public static File getFile(Artist artist) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue