core: make sure we don't call a null buffer

https://crash-reports.kde.org/organizations/kde/issues/66190/

(cherry picked from commit ff966678)

Co-authored-by: Aleix Pol aleixpol@kde.org

Merge request reports

Loading