Skip to content

Commit 14198a1

Browse files
exKAZUurozele
authored andcommitted
Do nothing if a previous transform is not be removed. (microsoft#1822)
When a WPF app uses `react-navigation`, the conditions `transforms == null` and `_transforms.Length == 0` can hold in the `SetTransform` method. In this case, `SetProjectionMatrix` method is invoked even though `transforms` is `null`, then `NullPointerException` occurs. So, this PR changes `SetTransform` method to not invoke `SetProjectionMatrix` method if `_transforms.Remove(view) == false`. Close microsoft#1821
1 parent f807db7 commit 14198a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ReactWindows/ReactNative.Net46/UIManager/BaseViewManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ public abstract class BaseViewManager<TFrameworkElement, TLayoutShadowNode> :
4242
[ReactProp("transform")]
4343
public void SetTransform(TFrameworkElement view, JArray transforms)
4444
{
45-
if (transforms == null && _transforms.Remove(view))
45+
if (transforms == null)
4646
{
47-
ResetProjectionMatrix(view);
47+
if (_transforms.Remove(view))
48+
{
49+
ResetProjectionMatrix(view);
50+
}
4851
}
4952
else
5053
{

0 commit comments

Comments
 (0)