Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 1639a6a

Browse files
Preventing the save of a blank name or email
1 parent da4d603 commit 1639a6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/UserSettingsView.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public override void OnGUI()
4848
newGitName = EditorGUILayout.TextField(GitConfigNameLabel, newGitName);
4949
newGitEmail = EditorGUILayout.TextField(GitConfigEmailLabel, newGitEmail);
5050

51-
var needsSaving = newGitName != gitName || newGitEmail != gitEmail;
51+
var needsSaving = (newGitName != gitName || newGitEmail != gitEmail)
52+
&& !(string.IsNullOrEmpty(newGitName) || string.IsNullOrEmpty(newGitEmail));
53+
5254
EditorGUI.BeginDisabledGroup(!needsSaving);
5355
{
5456
if (GUILayout.Button(GitConfigUserSave, GUILayout.ExpandWidth(false)))

0 commit comments

Comments
 (0)