Project

General

Profile

Actions

Improvements #10950

open

make WStandardItemModel more resilient

Added by Stefan Arndt about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
09/16/2022
Due date:
% Done:

0%

Estimated time:

Description

The following code will segfault:

auto model = std::make_unique<Wt::WStandardItemModel>();
model->removeColumns(0, model->columnCount());

Yes, the code does not make a lot of sense and the argument could be made that this is user error, but an API should be able to handle this gracefully.
I suggest simply doing nothing in removeColumns/Rows() if the count is zero - or throw an exception at my face :)

No data to display

Actions

Also available in: Atom PDF