diff --git a/PCK-Studio/Internal/PckNodeSorter.cs b/PCK-Studio/Internal/PckNodeSorter.cs index af2390ad..934bc1be 100644 --- a/PCK-Studio/Internal/PckNodeSorter.cs +++ b/PCK-Studio/Internal/PckNodeSorter.cs @@ -21,9 +21,9 @@ namespace PckStudio.Internal public int Compare(object x, object y) { - TreeNode tx = x as TreeNode; - TreeNode ty = y as TreeNode; - return Compare(tx, ty); + if (x is TreeNode tx && y is TreeNode ty) + return Compare(tx, ty); + return 0; } public int Compare(TreeNode x, TreeNode y)