[gitpushgialog] Check index validity
ClosedPublic

Authored by anthonyfieroni on Jan 16 2019, 6:14 AM.

Details

Summary

I test to push in repo that i don't have permissions, it crash before showing dialog. Now it show it.

Diff Detail

Repository
R449 Plugins for Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
anthonyfieroni requested review of this revision.Jan 16 2019, 6:14 AM
anthonyfieroni created this revision.
alexeymin accepted this revision.Jan 21 2019, 4:54 PM
alexeymin added a subscriber: alexeymin.

branches is a QStringList, so, we could also check that currentBranchIndex < branches.size() in condition, if it is all about bounds checking.
Anyway, the diff compiles and overall looks harmless. I'd say +1, I did not try to reproduce the crash though

This revision is now accepted and ready to land.Jan 21 2019, 4:54 PM

branches is a QStringList, so, we could also check that currentBranchIndex < branches.size() in condition, if it is all about bounds checking.

In this case GitWrapper::branches sets valid index or -1, so it's not need bound check.

This revision was automatically updated to reflect the committed changes.