Fix crash in JSON traversal in Bing potd provider
ClosedPublic

Authored by drosca on Apr 16 2017, 3:45 PM.

Details

Summary

QJsonArray::operator[] returns QJsonValueRef which seems to crash
when trying to convert to object.
Using QJsonArray::at() instead which returns QJsonValue fixes the crash.

BUG: 378590

Test Plan

No longer crashes

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
drosca created this revision.Apr 16 2017, 3:45 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 16 2017, 3:45 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

What about first()? In contrast to QList et al it's safe in JSON (also returns QJsonValue)

broulik accepted this revision.Apr 16 2017, 3:49 PM
This revision is now accepted and ready to land.Apr 16 2017, 3:49 PM
This revision was automatically updated to reflect the committed changes.