Skip to content

Commit b940c51

Browse files
committed
Fixed an issue that prevented saving attributes
Fixes #70
1 parent 2bae6ff commit b940c51

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

Settings.ascx.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,8 +1417,16 @@ private void lbAddAttribute_Click(object sender, System.EventArgs e)
14171417
{
14181418
RepositoryAttributesController attributes = new RepositoryAttributesController();
14191419
RepositoryAttributesInfo attribute = null;
1420-
int _key = int.Parse(ViewState["_key"].ToString());
1421-
int _index = int.Parse(ViewState["_index"].ToString());
1420+
int _key = Null.NullInteger;
1421+
if (ViewState["_key"] != null)
1422+
{
1423+
_key = int.TryParse(ViewState["_key"].ToString(), out _key) ? _key : Null.NullInteger;
1424+
}
1425+
int _index = Null.NullInteger;
1426+
if (ViewState["_index"] != null)
1427+
{
1428+
_index = int.TryParse(ViewState["_index"].ToString(), out _index) ? _index : Null.NullInteger;
1429+
}
14221430

14231431
if (lbAddAttribute.Text == Localization.GetString("SaveButton", LocalResourceFile))
14241432
{

0 commit comments

Comments
 (0)