Fix potential crash in KCmFontInst on invalid index

Authored by davidedmundson on Feb 23 2017, 12:32 PM.

Description

Fix potential crash in KCmFontInst on invalid index

Summary:
If !index.isValid() grp remains null and any use of it will crash.

There is a check for that, but then there's code relying on grp being
valid both before and after that check.

Test Plan: Compiles

Reviewers: Plasma, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D4394

Details