Avoid potential access of .last() on empty list

Review Request #129400 - Created Nov. 14, 2016 and submitted

Information
David Edmundson
kpackage
master
12213c9...
Reviewers
kdeframeworks, plasma
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.

Ran kpackagetool --generate-index -g

Previously asserted. No longer asserted.

Issues

  • 2
  • 0
  • 0
  • 2
Description From Last Updated
Then just change to QStandardPath::locate? Aleix Pol Gonzalez Aleix Pol Gonzalez
no, locate would return the first most suitable it found, that is usually the local one under ~/.local whuile this ... Marco Martin Marco Martin
Aleix Pol Gonzalez
Marco Martin
David Edmundson
Review request changed

Status: Closed (submitted)

Loading...