break;
case SortOption.Album:
- if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation).Album)
+ if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation)?.Album)
{
newGroupFlag = true;
- newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation).Album.ToString();
+ newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation)?.Album.ToString();
}
break;
case SortOption.Artist:
- if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation).Artist)
+ if (lastGroupItem == null || lastGroupItem.Title != (mediaInformationEx.MediaContentInformation as AudioInformation)?.Artist)
{
newGroupFlag = true;
- newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation).Artist.ToString();
+ newTitle = (mediaInformationEx.MediaContentInformation as AudioInformation)?.Artist.ToString();
}
break;
// Check 1 : The size of the image file must be less than 4MB.
var fileInfo = new FileInfo(mediaContent.MediaContentInformation.FilePath);
- if (fileInfo != null && fileInfo.Length > 8 * 1024 * 1024)
+ if (fileInfo?.Length > 8 * 1024 * 1024)
{
DbgPort.D(mediaContent.MediaContentInformation.DisplayName + ": This content is not available");
mediaContent.IsAvailable = false;
private void UpdateImageColor()
{
var img = Element as NinePatch;
- Control.Color = new ElmSharp.Color(Convert.ToInt32(img.ImageColor.R * 255), Convert.ToInt32(img.ImageColor.G * 255), Convert.ToInt32(img.ImageColor.B * 255), Convert.ToInt32(img.ImageColor.A * 255));
+ if (Control != null)
+ {
+ Control.Color = new ElmSharp.Color(Convert.ToInt32(img.ImageColor.R * 255), Convert.ToInt32(img.ImageColor.G * 255), Convert.ToInt32(img.ImageColor.B * 255), Convert.ToInt32(img.ImageColor.A * 255));
+ }
}
/// <summary>
void UpdateBorder()
{
var img = Element as NinePatch;
- Control.SetBorder(img.BorderLeft, img.BorderRight, img.BorderTop, img.BorderBottom);
+ Control?.SetBorder(img.BorderLeft, img.BorderRight, img.BorderTop, img.BorderBottom);
}
/// <summary>
length: 167,
finished: (v2, IsCanceled2) =>
{
- if (!IsCanceled)
+ if (!IsCanceled2)
{
GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
}
var x = this.X;
var y = this.Y;
var parent = (VisualElement)this.Parent;
- while (parent != null && parent.Parent.GetType() == typeof(VisualElement))
+ while (parent != null && parent.Parent?.GetType() == typeof(VisualElement))
{
x += parent.X;
y += parent.Y;
length: 167,
finished: (v2, IsCanceled2) =>
{
- if (!IsCanceled)
+ if (!IsCanceled2)
{
GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
}
length: 167,
finished: (v2, IsCanceled2) =>
{
- if (!IsCanceled)
+ if (!IsCanceled2)
{
GroupTitle.TextColor = Color.FromRgba(0, 129, 198, 255);
}