Skip to content

Commit

Permalink
Null ref
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sadegh-sh committed Dec 27, 2023
1 parent cf7bf10 commit 8211d28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
22 changes: 6 additions & 16 deletions Core/UI.Parts/Length/Length.Auto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ public Length Set(AutoStrategy strategy)
AutoOption = strategy;
ApplyAutoStrategy();

if (Owner.parent is null)
Owner.ParentSet.Event += TryAttach;
else TryAttach();
if (Owner.parent is not null) TryAttach();
else Owner.ParentSet.Event += TryAttach;

void TryAttach()
{
Expand All @@ -57,7 +56,7 @@ void TryAttach()

void HeightContainer()
{
if (Owner.parent is not Stack stack) return;
if (Owner?.parent is not Stack stack) return;

void Attach(View sibling)
{
Expand All @@ -79,10 +78,7 @@ void Attach(View sibling)

void WidthContainer()
{
if (Owner.parent is not Stack stack)
{
return;
}
if (Owner?.parent is not Stack stack) return;

void Attach(View sibling)
{
Expand All @@ -104,10 +100,7 @@ void Attach(View sibling)

void HeightContent()
{
if (Owner is not Stack stack)
{
return;
}
if (Owner is not Stack stack) return;

void Attach(View sibling)
{
Expand All @@ -129,10 +122,7 @@ void Attach(View sibling)

void WidthContent()
{
if (Owner is not Stack stack)
{
return;
}
if (Owner is not Stack stack) return;

void Attach(View sibling)
{
Expand Down
2 changes: 1 addition & 1 deletion Zebble/Zebble.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RootNamespace>Zebble</RootNamespace>
<PackageId>Zebble</PackageId>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Version>4.6.118.0</Version>
<Version>4.6.119.0</Version>
<PackOnBuild>true</PackOnBuild>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
Expand Down

0 comments on commit 8211d28

Please sign in to comment.