Skip to content

Commit

Permalink
fix exception on passing value == null and encoding == null to FStrin…
Browse files Browse the repository at this point in the history
…g constructor
  • Loading branch information
atenfyr committed Jan 30, 2025
1 parent 6487818 commit c380bf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion UAssetAPI/UnrealTypes/FString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static FString FromString(string value, Encoding encoding = null)

public FString(string value, Encoding encoding = null)
{
if (encoding == null) encoding = Encoding.UTF8.GetByteCount(value) == value.Length ? Encoding.ASCII : Encoding.Unicode;
if (encoding == null && value != null) encoding = Encoding.UTF8.GetByteCount(value) == value.Length ? Encoding.ASCII : Encoding.Unicode;

Value = value;
Encoding = encoding;
Expand Down

0 comments on commit c380bf3

Please sign in to comment.