Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit 5913654

Browse files
dahlbyknulltoken
authored andcommitted
Add preemptive config null check
libgit2 will throw if you set a NULL value, so we might as well.
1 parent 9377253 commit 5913654

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

LibGit2Sharp/Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public virtual ConfigurationEntry<T> Get<T>(string key, ConfigurationLevel level
227227
/// <param name="level">The configuration file which should be considered as the target of this operation</param>
228228
public virtual void Set<T>(string key, T value, ConfigurationLevel level = ConfigurationLevel.Local)
229229
{
230+
Ensure.ArgumentNotNull(value, "value");
230231
Ensure.ArgumentNotNullOrEmptyString(key, "key");
231232

232233
using (ConfigurationSafeHandle h = RetrieveConfigurationHandle(level, true, configHandle))

0 commit comments

Comments
 (0)