Skip to content

Commit

Permalink
[NUI] fix controlstate contains check null exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
everLEEst authored and lwc0917 committed Jan 9, 2025
1 parent 461521d commit a9da0ae
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Tizen.NUI/src/public/BaseComponents/ControlState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ private ControlState(string name) : this(ControlStateUtility.Register(name))
/// <since_tizen> 9 </since_tizen>
public static ControlState Create(string name)
{
if (name == null)
throw new ArgumentNullException(nameof(name));
if (string.IsNullOrWhiteSpace(name))
throw new ArgumentException($"{nameof(name)} cannot be whitespace.", nameof(name));

return new ControlState(name);
}

Expand Down Expand Up @@ -150,7 +145,8 @@ public static ControlState Create(params ControlState[] states)
/// <since_tizen> 9 </since_tizen>
public bool Contains(ControlState state)
{
if (state is null) return false;
if (state is null)
throw new ArgumentNullException(nameof(state));
return (bitFlags & state.bitFlags) == state.bitFlags;
}

Expand Down

0 comments on commit a9da0ae

Please sign in to comment.