Skip to content

kastatsfavoritesmodel.cpp: prefer .value() over operator[]

Akseli Lahtinen requested to merge work/cherry-pick-29e38fdf into Plasma/6.1
  • In removeResult, use resource directly so we are not comparing to a possible nullptr which can cause crashing
  • Prefer .value over operator[] to avoid leaving behind nullptr entries when reading items

BUG:482887

(cherry picked from commit 29e38fdf)

050c8cc6 kastatsfavoritesmodel.cpp: make sure it.value exists before trying to reload faf522c7 Compare value-id directly to resource in removeResult 81ad3a75 Use .value instead of operator[] 737178d2 Remove guards f0bce1fc Add a comment about the entry value

Co-authored-by: Akseli Lahtinen akselmo@akselmo.dev

Merge request reports