Skip to content

Commit

Permalink
RavenDB-4739 DefaultFileSystem can be null or we should throw earlier (
Browse files Browse the repository at this point in the history
  • Loading branch information
ml054 authored and ayende committed Jul 4, 2016
1 parent 8c4494a commit a5d0429
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Raven.Client.Lightweight/FileSystem/FilesStore.cs
Expand Up @@ -126,7 +126,19 @@ public virtual HttpJsonRequestFactory JsonRequestFactory
}
}

public string DefaultFileSystem { get; set; }
public string DefaultFileSystem
{
get { return defaultFileSystem; }
set
{
if (string.IsNullOrEmpty(value))
throw new ArgumentException("DefaultFileSystem can not be null or empty");
defaultFileSystem = value;
}
}

private string defaultFileSystem;

private bool disableReplicationInformerGeneration = false;
public IFilesReplicationInformer GetReplicationInformerForFileSystem(string fsName = null)
{
Expand Down
14 changes: 14 additions & 0 deletions Raven.Tests.FileSystem/ClientApi/FileSessionTests.cs
Expand Up @@ -867,5 +867,19 @@ public async Task ShouldNotAttemptToLoadAlreadyDeletedFile()
}
}
}

[Fact]
public void DefaultFileSystemCannotBeEmptyOrNull()
{
Assert.Throws<ArgumentException>(() => new FilesStore
{
DefaultFileSystem = null
});

Assert.Throws<ArgumentException>(() => new FilesStore
{
DefaultFileSystem = ""
});
}
}
}

0 comments on commit a5d0429

Please sign in to comment.