From d51150a430c065da7d3a793f72e2b5fe4c0471ef Mon Sep 17 00:00:00 2001 From: Michael Seibt Date: Tue, 24 Feb 2026 13:03:52 +0100 Subject: [PATCH 1/2] Turn SF in WContainerWidget::widget into exception The SF occurred when calling WTableView::setHeaderHeight during WebController::doCreateApplication. --- src/Wt/WContainerWidget.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Wt/WContainerWidget.C b/src/Wt/WContainerWidget.C index 7f93ee604..edc782471 100644 --- a/src/Wt/WContainerWidget.C +++ b/src/Wt/WContainerWidget.C @@ -241,6 +241,9 @@ int WContainerWidget::indexOf(WWidget *widget) const WWidget *WContainerWidget::widget(int index) const { + if (index < 0 || index >= children_.size()) + throw Wt::WException("WContainerWidget::widget: index " + std::to_string(index) + + " is out of range [0, " + std::to_string(children_.size()) + ")"); return children_[index]; } From 02d03af312a0bd16d14d555f71ea30f7ba76d725 Mon Sep 17 00:00:00 2001 From: Michael Seibt Date: Tue, 24 Feb 2026 13:35:48 +0100 Subject: [PATCH 2/2] Fix WTableView accessing nonexisting header widget --- src/Wt/WTableView.C | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Wt/WTableView.C b/src/Wt/WTableView.C index c3e1a93fd..bd82aad57 100644 --- a/src/Wt/WTableView.C +++ b/src/Wt/WTableView.C @@ -1315,8 +1315,12 @@ WWidget* WTableView::headerWidget(int column, bool contentsOnly) result = headers_->widget(column - headerColumnsTable_->count()); } } else - if (plainTable_ && column < plainTable_->columnCount()) - result = plainTable_->elementAt(0, column)->widget(0); + if (plainTable_ && column < plainTable_->columnCount()) { + WTableCell *headerCell = plainTable_->elementAt(0, column); + if (headerCell->count() == 0) + return result; + result = headerCell->widget(0); + } if (result && contentsOnly) return result->find("contents");