mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Linux - Fix crash in keyframes
This commit is contained in:
parent
257fa8ae0d
commit
107b604c86
@ -250,15 +250,11 @@ public abstract partial class TreeItemViewModel : ActivatableViewModelBase
|
|||||||
|
|
||||||
private async void UpdateCanPaste(bool isFlyoutOpen)
|
private async void UpdateCanPaste(bool isFlyoutOpen)
|
||||||
{
|
{
|
||||||
string[] formats = await Shared.UI.Clipboard.GetFormatsAsync();
|
string[]? formats = await Shared.UI.Clipboard.GetFormatsAsync();
|
||||||
//diogotr7: This can be null on Linux sometimes. I'm not sure why.
|
|
||||||
if (formats == null!)
|
|
||||||
{
|
|
||||||
CanPaste = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CanPaste = formats.Contains(ProfileElementExtensions.ClipboardDataFormat);
|
// Can be null on some platforms
|
||||||
|
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
|
||||||
|
CanPaste = formats != null && formats.Contains(ProfileElementExtensions.ClipboardDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool GetIsFocused(ProfileEditorFocusMode focusMode, RenderProfileElement? currentProfileElement)
|
private bool GetIsFocused(ProfileEditorFocusMode focusMode, RenderProfileElement? currentProfileElement)
|
||||||
|
|||||||
@ -174,8 +174,11 @@ public partial class TimelineKeyframeViewModel<T> : ActivatableViewModelBase, IT
|
|||||||
|
|
||||||
private async void UpdateCanPaste(bool isFlyoutOpen)
|
private async void UpdateCanPaste(bool isFlyoutOpen)
|
||||||
{
|
{
|
||||||
string[] formats = await Shared.UI.Clipboard.GetFormatsAsync();
|
string[]? formats = await Shared.UI.Clipboard.GetFormatsAsync();
|
||||||
CanPaste = formats.Contains("Artemis.Keyframes");
|
|
||||||
|
// Can be null on some platforms
|
||||||
|
// ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
|
||||||
|
CanPaste = formats != null && formats.Contains("Artemis.Keyframes");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user