Skip to content

Commit

Permalink
sometimes there is name is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Folleach committed Jan 12, 2024
1 parent 2579215 commit 3740937
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions GeometryDashAPI/Data/Models/LevelCreatorModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ public class LevelCreatorModel
internal string? KeyInDict { get; private set; }
public Plist DataLevel { get; set; }

public string Name
public string? Name
{
get => DataLevel["k2"];
set => DataLevel["k2"] = value;
get => DataLevel.TryGetValue("k2", out var name) ? name : null;
set => DataLevel["k2"] = value!;
}

public string Description
{
get => DataLevel.ContainsKey("k3") ? Encoding.ASCII.GetString(Convert.FromBase64String(DataLevel["k3"])) : "";
Expand All @@ -23,11 +24,12 @@ public string Description

public string LevelString => DataLevel.ContainsKey("k4") ? DataLevel["k4"] : Level.DefaultLevelString;

public string AuthorName
public string? AuthorName
{
get => DataLevel["k5"];
set => DataLevel["k5"] = value;
get => DataLevel.TryGetValue("k5", out var name) ? name : null;
set => DataLevel["k5"] = value!;
}

public bool Verified
{
get => DataLevel.ContainsKey("k14") ? DataLevel["k14"] : false;
Expand Down

0 comments on commit 3740937

Please sign in to comment.