Fix error on invalid resource item.
This commit is contained in:
@@ -43,12 +43,18 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
m_cover.sprite = m_coverPlaceholder;
|
||||
if (data.Cover != null) data.Cover.Destination = DisplayCover;
|
||||
var meta = data.Meta;
|
||||
m_title.text = string.Format("{0}\n{1}", meta.song.name, meta.name);
|
||||
m_desc.text = string.Format(
|
||||
"Music artist: {0}\nCharter: {1}\nLength: {2}\nNote Count: {3}",
|
||||
meta.song.author, meta.author,
|
||||
TimeSpan.FromSeconds(meta.length).ToString(3), meta.note_count
|
||||
);
|
||||
if (meta != null) {
|
||||
m_title.text = string.Format("{0}\n{1}", meta.song.name, meta.name);
|
||||
m_desc.text = string.Format(
|
||||
"Music artist: {0}\nCharter: {1}\nLength: {2}\nNote Count: {3}",
|
||||
meta.song.author, meta.author,
|
||||
TimeSpan.FromSeconds(meta.length).ToString(3), meta.note_count
|
||||
);
|
||||
}
|
||||
else {
|
||||
m_title.text = "<color=#ff0000>Invalid resource</color>";
|
||||
m_desc.text = string.Empty;
|
||||
}
|
||||
}
|
||||
private void DisplayCover(bool succeeded, Texture2D tex) {
|
||||
if (succeeded) {
|
||||
|
Reference in New Issue
Block a user