Skip to content

Commit

Permalink
Improve input validation in the LedgerPath class
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavien committed Jan 4, 2016
1 parent 61a12fc commit ce527ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Openchain.Infrastructure/LedgerPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ private LedgerPath(string path, IEnumerable<string> segments)
public static bool TryParse(string path, out LedgerPath result)
{
result = null;

if (path == null)
return false;

string[] segments = path.Split('/');
if (segments.Length < 2 || segments[0] != string.Empty || segments[segments.Length - 1] != string.Empty)
return false;
Expand Down

0 comments on commit ce527ea

Please sign in to comment.