diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 849835e5bba..71efcee56b1 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -103,25 +103,25 @@
-
+
https://github.com/dotnet/arcade
- ee39cd1573dbb8011f343e1037af51d4fc00a747
+ 6813f5aa511a7a4498fa217a54219b5704a01f83
-
+
https://github.com/dotnet/arcade
- ee39cd1573dbb8011f343e1037af51d4fc00a747
+ 6813f5aa511a7a4498fa217a54219b5704a01f83
-
+
https://github.com/dotnet/arcade
- ee39cd1573dbb8011f343e1037af51d4fc00a747
+ 6813f5aa511a7a4498fa217a54219b5704a01f83
-
+
https://github.com/dotnet/arcade
- ee39cd1573dbb8011f343e1037af51d4fc00a747
+ 6813f5aa511a7a4498fa217a54219b5704a01f83
-
+
https://github.com/dotnet/arcade
- ee39cd1573dbb8011f343e1037af51d4fc00a747
+ 6813f5aa511a7a4498fa217a54219b5704a01f83
diff --git a/eng/Versions.props b/eng/Versions.props
index 87ef01e154b..55fe4060b57 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -42,9 +42,9 @@
- 5.0.0-beta.20506.7
- 5.0.0-beta.20506.7
- 5.0.0-beta.20506.7
+ 5.0.0-beta.20510.1
+ 5.0.0-beta.20510.1
+ 5.0.0-beta.20510.1
diff --git a/global.json b/global.json
index 4898761a3cc..d9fb12e0af9 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"tools": {
- "dotnet": "5.0.100-rc.1.20452.10",
+ "dotnet": "5.0.100-rc.2.20479.15",
"runtimes": {
"dotnet": [
"2.1.7",
@@ -12,11 +12,11 @@
}
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20506.7",
- "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20506.7"
+ "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20510.1",
+ "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20510.1"
},
"sdk": {
- "version": "5.0.100-rc.1.20452.10"
+ "version": "5.0.100-rc.2.20479.15"
},
"native-tools": {
"strawberry-perl": "5.28.1.1-1",
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/EllipseGeometry.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/EllipseGeometry.cs
index 8d7c077800c..bc5224d6463 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/EllipseGeometry.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/EllipseGeometry.cs
@@ -160,9 +160,6 @@ internal static Rect GetBoundsHelper(Pen pen, Matrix worldMatrix, Point center,
{
Rect rect;
- Debug.Assert(worldMatrix != null);
- Debug.Assert(geometryMatrix != null);
-
if ( (pen == null || pen.DoesNotContainGaps) &&
worldMatrix.IsIdentity && geometryMatrix.IsIdentity)
{
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSourceSafeMILHandle.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSourceSafeMILHandle.cs
index 5a11194f1f4..0f53e6288bb 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSourceSafeMILHandle.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/BitmapSourceSafeMILHandle.cs
@@ -71,7 +71,7 @@ private static long ComputeEstimatedSize(IntPtr bitmapObject)
{
long estimatedSize = 0;
- if (bitmapObject != null && bitmapObject != IntPtr.Zero)
+ if (bitmapObject != IntPtr.Zero)
{
IntPtr wicBitmap;
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs
index d3ae38311b2..3bc0e4ff449 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Imaging/WriteableBitmap.cs
@@ -85,15 +85,6 @@ BitmapPalette palette
// Sanitize inputs
//
- if (pixelFormat == null)
- {
- // Backwards Compat:
- //
- // The original code would null-ref, but we choose to raise a
- // better exception.
- throw new ArgumentNullException("pixelFormat");
- }
-
if (pixelFormat.Palettized && palette == null)
{
throw new InvalidOperationException(SR.Get(SRID.Image_IndexedPixelFormatRequiresPalette));
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/LineGeometry.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/LineGeometry.cs
index daa2c16a7e4..34c864211e5 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/LineGeometry.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/LineGeometry.cs
@@ -107,9 +107,6 @@ internal override Rect GetBoundsInternal(Pen pen, Matrix worldMatrix, double tol
internal static Rect GetBoundsHelper(Pen pen, Matrix worldMatrix, Point pt1, Point pt2,
Matrix geometryMatrix, double tolerance, ToleranceType type)
{
- Debug.Assert(worldMatrix != null);
- Debug.Assert(geometryMatrix != null);
-
if (pen == null && worldMatrix.IsIdentity && geometryMatrix.IsIdentity)
{
return new Rect(pt1, pt2);
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/RectangleGeometry.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/RectangleGeometry.cs
index a204c8fa2d2..3abf8d26275 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/RectangleGeometry.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/RectangleGeometry.cs
@@ -190,9 +190,6 @@ internal static Rect GetBoundsHelper(Pen pen, Matrix worldMatrix, Rect rect, dou
{
Rect boundingRect;
- Debug.Assert(worldMatrix != null);
- Debug.Assert(geometryMatrix != null);
-
if (rect.IsEmpty)
{
boundingRect = Rect.Empty;
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media3D/GeneralTransform3DTo2D.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media3D/GeneralTransform3DTo2D.cs
index 48bb9135b85..3fc14575539 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media3D/GeneralTransform3DTo2D.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media3D/GeneralTransform3DTo2D.cs
@@ -43,15 +43,13 @@ public bool TryTransform(Point3D inPoint, out Point result)
result = new Point();
// project the point
- if (_projectionTransform != null)
- {
Point3D projectedPoint = _projectionTransform.Transform(inPoint);
-
- if (_transformBetween2D != null)
- {
- result = _transformBetween2D.Transform(new Point(projectedPoint.X, projectedPoint.Y));
- success = true;
- }
- }
+ Point3D projectedPoint = _projectionTransform.Transform(inPoint);
+
+ if (_transformBetween2D != null)
+ {
+ result = _transformBetween2D.Transform(new Point(projectedPoint.X, projectedPoint.Y));
+ success = true;
+ }
return success;
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/indexingfiltermarshaler.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/indexingfiltermarshaler.cs
index e8e6b15f34c..aaf0caaa619 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/indexingfiltermarshaler.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/IO/Packaging/indexingfiltermarshaler.cs
@@ -215,8 +215,9 @@ internal static IntPtr MarshalPropVariant(Object obj)
// allocate an unmanaged PROPVARIANT to return
pNative = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(PROPVARIANT)));
- // Per MSDN, AllocCoTaskMem never returns null. One can't be too careful, though.
- Invariant.Assert(pNative != null);
+
+ // Per MSDN, AllocCoTaskMem never returns null: check for IntPtr.Zero instead.
+ Invariant.Assert(pNative != IntPtr.Zero);
// marshal the managed PROPVARIANT into the unmanaged block and return it
Marshal.StructureToPtr(v, pNative, false);
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Printing/printdlgexmarshaler.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Printing/printdlgexmarshaler.cs
index 38f464a2a95..d5be8f8c31d 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Printing/printdlgexmarshaler.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Printing/printdlgexmarshaler.cs
@@ -628,7 +628,7 @@ IntPtr unmanagedBuffer
}
catch (Exception)
{
- if (unmanagedBuffer != null)
+ if (unmanagedBuffer != IntPtr.Zero)
{
FreeUnmanagedPrintDlgExStruct(unmanagedBuffer);
unmanagedBuffer = IntPtr.Zero;
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/CellParaClient.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/CellParaClient.cs
index 14d44788f8c..4b643148c46 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/CellParaClient.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/PtsHost/CellParaClient.cs
@@ -157,7 +157,7 @@ internal void FormatCellFinite(Size subpageSize, IntPtr breakRecordIn, bool isEm
int dvrTopSpace;
PTS.FSPAP fspap;
- if(CellParagraph.StructuralCache.DtrList != null && breakRecordIn != null)
+ if(CellParagraph.StructuralCache.DtrList != null && breakRecordIn != IntPtr.Zero)
{
CellParagraph.InvalidateStructure(TextContainerHelper.GetCPFromElement(CellParagraph.StructuralCache.TextContainer, CellParagraph.Element, ElementEdge.BeforeStart));
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs
index cf159ed3b72..ccbf13294a0 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/WindowsRuntime/Generated/WinRT/Marshalers.cs
@@ -127,7 +127,7 @@ public void Dispose()
marshaler?.Dispose();
}
}
- if (_array != null)
+ if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
@@ -445,7 +445,7 @@ public void Dispose()
Marshaler.DisposeMarshaler(marshaler);
}
}
- if (_array != null)
+ if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
@@ -627,7 +627,7 @@ public void Dispose()
DisposeMarshaler(marshaler);
}
}
- if (_array != null)
+ if (_array != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(_array);
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DateTimeAutomationPeer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DateTimeAutomationPeer.cs
index 10d71f9d44b..6ed7fd6a0fc 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DateTimeAutomationPeer.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Automation/Peers/DateTimeAutomationPeer.cs
@@ -30,10 +30,6 @@ public sealed class DateTimeAutomationPeer : AutomationPeer, IGridItemProvider,
internal DateTimeAutomationPeer(DateTime date, Calendar owningCalendar, CalendarMode buttonMode)
: base()
{
- if (date == null)
- {
- throw new ArgumentNullException("date");
- }
if (owningCalendar == null)
{
throw new ArgumentNullException("owningCalendar");
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Calendar.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Calendar.cs
index 8b483986745..e7b7e7134c0 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Calendar.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Calendar.cs
@@ -1380,23 +1380,20 @@ private void ProcessEndKey(bool shift)
{
case CalendarMode.Month:
{
- if (this.DisplayDate != null)
- {
- DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
-
- if (DateTimeHelper.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0)
- {
- // since DisplayDate is not equal to DateTime.MaxValue we are sure selectedDate is not null
- selectedDate = DateTimeHelper.AddMonths(selectedDate.Value, 1).Value;
- selectedDate = DateTimeHelper.AddDays(selectedDate.Value, -1).Value;
- }
- else
- {
- selectedDate = DateTime.MaxValue;
- }
+ DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
- ProcessSelection(shift, selectedDate);
+ if (DateTimeHelper.CompareYearMonth(DateTime.MaxValue, selectedDate.Value) > 0)
+ {
+ // since DisplayDate is not equal to DateTime.MaxValue we are sure selectedDate is not null
+ selectedDate = DateTimeHelper.AddMonths(selectedDate.Value, 1).Value;
+ selectedDate = DateTimeHelper.AddDays(selectedDate.Value, -1).Value;
}
+ else
+ {
+ selectedDate = DateTime.MaxValue;
+ }
+
+ ProcessSelection(shift, selectedDate);
break;
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/CalendarBlackoutDatesCollection.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/CalendarBlackoutDatesCollection.cs
index 7d543ccc2e7..0f6c3b403a9 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/CalendarBlackoutDatesCollection.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/CalendarBlackoutDatesCollection.cs
@@ -349,9 +349,6 @@ private bool IsValidThread()
///
private CalendarDateRange GetContainingDateRange(DateTime date)
{
- if (date == null)
- return null;
-
for (int i = 0; i < Count; i++)
{
if (DateTimeHelper.InRange(date, this[i]))
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridCell.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridCell.cs
index 6f55d34c8dc..6358bf00e7d 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridCell.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridCell.cs
@@ -278,7 +278,7 @@ internal void NotifyPropertyChanged(DependencyObject d, string propertyName, Dep
{
column.RefreshCellContent(this, propertyName);
}
- else if (e != null && e.Property != null)
+ else if (e.Property != null)
{
column.RefreshCellContent(this, e.Property.Name);
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/CalendarItem.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/CalendarItem.cs
index f19015c935c..29cc92bba9f 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/CalendarItem.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/Primitives/CalendarItem.cs
@@ -681,7 +681,6 @@ private void Cell_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
CalendarKeyboardHelper.GetMetaKeyState(out ctrl, out shift);
DateTime selectedDate = (DateTime)b.DataContext;
- Debug.Assert(selectedDate != null);
switch (this.Owner.SelectionMode)
{
@@ -1303,7 +1302,6 @@ private void SetYearModeMonthButtons()
if (this.Owner != null)
{
- Debug.Assert(this.Owner.DisplayDateInternal != null);
childButton.HasSelectedDays = (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateInternal) == 0);
if (DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateStartInternal) < 0 || DateTimeHelper.CompareYearMonth(day, this.Owner.DisplayDateEndInternal) > 0)
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/SelectedDatesCollection.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/SelectedDatesCollection.cs
index a5c960137f8..969b696f89a 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/SelectedDatesCollection.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/SelectedDatesCollection.cs
@@ -278,7 +278,7 @@ protected override void SetItem(int index, DateTime item)
}
else
{
- if (item != null && DateTime.Compare(this[index], item) != 0 && Calendar.IsValidDateSelection(this._owner, item))
+ if (DateTime.Compare(this[index], item) != 0 && Calendar.IsValidDateSelection(this._owner, item))
{
removedItems.Add(this[index]);
base.SetItem(index, item);
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Data/BindingExpression.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Data/BindingExpression.cs
index 2b25d922d5e..7ccbe125d62 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Data/BindingExpression.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Data/BindingExpression.cs
@@ -220,8 +220,6 @@ internal override void OnPropertyInvalidation(DependencyObject d, DependencyProp
{
if (d == null)
throw new ArgumentNullException("d");
- if (args == null)
- throw new ArgumentNullException("args");
DependencyProperty dp = args.Property;
if (dp == null)
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs
index bfd0d63d767..eb6beefb2ec 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs
@@ -4589,7 +4589,8 @@ protected sealed override void ArrangeCore(Rect finalRect)
// First, get clipped, transformed, unrounded size.
if (useLayoutRounding)
{
- if (ltd != null && ltd.TransformedUnroundedDS != null)
+ // 'transformUnroundedDS' is a non-nullable value type and can never be null.
+ if (ltd != null)
{
transformedUnroundedDS = ltd.TransformedUnroundedDS;
transformedUnroundedDS.Width = Math.Max(0, transformedUnroundedDS.Width - marginWidth);
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs
index fc19dd6d92e..1b65ea82a86 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs
@@ -2797,7 +2797,7 @@ public static MONITORINFO GetMonitorInfo(IntPtr hMonitor)
public static IntPtr GetStockObject(StockObject fnObject)
{
IntPtr retPtr = _GetStockObject(fnObject);
- if (retPtr == null)
+ if (retPtr == IntPtr.Zero)
{
HRESULT.ThrowLastError();
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/VisualStateManager.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/VisualStateManager.cs
index 6cfe7cd829b..7824e9107d7 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/VisualStateManager.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/VisualStateManager.cs
@@ -408,7 +408,7 @@ private static Storyboard GenerateDynamicTransitionAnimations(FrameworkElement r
if (transition != null)
{
- if (transition.GeneratedDuration != null)
+ if (transition.GeneratedDuration != DurationZero)
{
dynamic.Duration = transition.GeneratedDuration;
}
diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs
index b5537ef5d49..d15232b2f15 100644
--- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs
+++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs
@@ -6148,7 +6148,7 @@ private static object CoerceRenderTransform(DependencyObject d, object value)
Transform renderTransformValue = (Transform)value;
if ((value == null) ||
- (renderTransformValue != null && renderTransformValue.Value != null && renderTransformValue.Value.IsIdentity == true))
+ (renderTransformValue != null && renderTransformValue.Value.IsIdentity == true))
{
// setting this value is allowed.
}
diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/HwndSubclass.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/HwndSubclass.cs
index e9dc2e01ecc..3048eafdfa3 100644
--- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/HwndSubclass.cs
+++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/HwndSubclass.cs
@@ -553,7 +553,8 @@ private bool UnhookWindowProc(bool force)
//AvDebug.Assert(_gcHandle.IsAllocated, "External GC handle has not been allocated.");
- if(null != _gcHandle)
+ // GCHandle is a non-nullable type. Check GCHandle.IsAllocated before calling Free().
+ if(_gcHandle.IsAllocated)
_gcHandle.Free();
return true;
diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Security/RightsManagement/IssuanceLicense.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Security/RightsManagement/IssuanceLicense.cs
index a7b7ab94970..79e579cbec8 100644
--- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Security/RightsManagement/IssuanceLicense.cs
+++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Security/RightsManagement/IssuanceLicense.cs
@@ -180,8 +180,8 @@ private void Initialize(
}
}
- // set metafata as required
- if (contentId != null)
+ // set metadata as required
+ if (contentId != Guid.Empty)
{
hr = SafeNativeMethods.DRMSetMetaData(
_issuanceLicenseHandle,
diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
index 0b895b3dee9..abbf7e8fa01 100644
--- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
+++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/SplashScreen.cs
@@ -238,7 +238,7 @@ private object CloseInternal(Object fadeOutArg)
// In the case where the developer has specified AutoClose=True and then calls
// Close(non_zero_timespan) before the auto close operation is dispatched we begin
// the fadeout immidiately and ignore the later call to close.
- if (_dt != null || _hwnd == null)
+ if (_dt != null || _hwnd == IntPtr.Zero)
{
return BooleanBoxes.TrueBox;
}