0

I am working on my first game and have encountered an issue using the dreamlo scoreboard asset. It is basically a simple leaderboard system working using only HTTP GET requests, and no PhP/SQL. You can read more about it here: Dreamlo

Using the class coming with the asset, I am getting a NullReferenceException on this function:

public string[] ToStringArray()
{
    if (this.highScores == "") return null;


    string[] rows = this.highScores.Split(new char[] { '\n' }, System.StringSplitOptions.RemoveEmptyEntries);
    return rows;
}

Note that my program runs fine, and leaderboards are shown, but as soon as it gets to this function I am spammed with 19 NullReferenceExceptions.

Cœur
  • 32,421
  • 21
  • 173
  • 232

1 Answers1

1

Learn more about NullReferenceException.

And try this line:

 if (string.IsNullOrEmpty(this.highScores)) return null;
Cœur
  • 32,421
  • 21
  • 173
  • 232
Umair M
  • 8,566
  • 3
  • 33
  • 67