Skip to content
This repository has been archived by the owner on Apr 30, 2023. It is now read-only.

Can not update a value to null #55

Closed
softlion opened this issue Jun 27, 2015 · 2 comments
Closed

Can not update a value to null #55

softlion opened this issue Jun 27, 2015 · 2 comments

Comments

@softlion
Copy link

in AddOrUpdateValue, the line:

        var type = value.GetType();

crashes if value is null.
It should be replaced with:

    public bool AddOrUpdateValue<T>(string key, T value = default(T))
    {
        if(string.IsNullOrEmpty(key))
            throw new ArgumentException("Key must have a value", "key");

        var type = typeof(T);
@Cheesebaron
Copy link
Owner

Why would you want to update the value to null? Why not just remove the setting entirely?

@softlion
Copy link
Author

Well currently the plugin crashes.
I just make sure it won't.

B.

Le dimanche 28 juin 2015, Tomasz Cielecki notifications@github.com a
écrit :

Why would you want to update the value to null? Why not just remove the
setting entirely?


Reply to this email directly or view it on GitHub
#55 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants