An expression that is always true
V3022 Expression ‘string.IsNullOrEmpty(rev1) || string.IsNullOrEmpty(rev2)’ is always true. GitUI FormFormatPatch.cs 155
string rev1 = ""; string rev2 = ""; var revisions = RevisionGrid.GetSelectedRevisions(); if (revisions.Count > 0) { rev1 = ....; rev2 = ....; .... } else if (string.IsNullOrEmpty(rev1) || string.IsNullOrEmpty(rev2)) { MessageBox.Show(....); return; }
Having analyzed the code, we can draw the conclusion that the else statement is used by mistake here. Removing it from the specified fragment eliminates the error caused by the fact that the second check is always true.
Please click here to see more bugs from this project.