Review Request 129400: Avoid potential access of .last() on empty list

David Edmundson david at davidedmundson.co.uk
Tue Nov 15 13:30:59 UTC 2016



> On Nov. 14, 2016, 1:40 p.m., Aleix Pol Gonzalez wrote:
> > src/kpackagetool/kpackagetool.cpp, line 502
> > <https://git.reviewboard.kde.org/r/129400/diff/1/?file=485449#file485449line502>
> >
> >     Then just change to `QStandardPath::locate`?

Sounds sensible to me. Though I don't really know this code.
Marco, should I do that?


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129400/#review100834
-----------------------------------------------------------


On Nov. 14, 2016, 1:35 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129400/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2016, 1:35 p.m.)
> 
> 
> Review request for KDE Frameworks and Plasma.
> 
> 
> Repository: kpackage
> 
> 
> Description
> -------
> 
> locateAll can return nothing, therefore we can't always call .last() on
> it.
> 
> Existing code should be able to handle an empty package root as the user
> could also also have provided a broken package root as an argument.
> 
> 
> Diffs
> -----
> 
>   src/kpackagetool/kpackagetool.cpp 6135e14ba717d579553036f9ed7874813046a1db 
> 
> Diff: https://git.reviewboard.kde.org/r/129400/diff/
> 
> 
> Testing
> -------
> 
> Ran kpackagetool --generate-index -g
> 
> Previously asserted. No longer asserted.
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161115/e46b400e/attachment.html>


More information about the Plasma-devel mailing list