forked from qt-creator/qt-creator
TextEditor: prevent crash on updating the completion model
Prevent updating the model with something other than a generic proposal model. Change-Id: I3880c1ce4ae7cf0aa4fb72d59b75a40db3f53482 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -289,7 +289,12 @@ public:
|
||||
{
|
||||
if (!proposal)
|
||||
return;
|
||||
updateModel(proposal->model(), prefix);
|
||||
if (proposal->id() != TextEditor::Constants::GENERIC_PROPOSAL_ID) {
|
||||
// We received something else than a generic proposal so we cannot update the model
|
||||
closeProposal();
|
||||
return;
|
||||
}
|
||||
updateModel(proposal->model().staticCast<GenericProposalModel>(), prefix);
|
||||
delete proposal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user