Skip to content

Commit 3d79a42

Browse files
committed
fix: unused param, mock defaults, reconnect nil guard
1 parent 62069b1 commit 3d79a42

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

mdl/backend/mock/mock_mutation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ func (m *MockBackend) BuildDataGrid2Widget(id model.ID, name string, spec backen
101101
if m.BuildDataGrid2WidgetFunc != nil {
102102
return m.BuildDataGrid2WidgetFunc(id, name, spec, projectPath)
103103
}
104-
return nil, nil
104+
return nil, fmt.Errorf("MockBackend.BuildDataGrid2Widget not configured")
105105
}
106106

107107
func (m *MockBackend) BuildFilterWidget(spec backend.FilterWidgetSpec, projectPath string) (pages.Widget, error) {
108108
if m.BuildFilterWidgetFunc != nil {
109109
return m.BuildFilterWidgetFunc(spec, projectPath)
110110
}
111-
return nil, nil
111+
return nil, fmt.Errorf("MockBackend.BuildFilterWidget not configured")
112112
}

mdl/backend/mpr/datagrid_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ func (b *MprBackend) applyDataGridSelectionProp(obj bson.D, propertyTypeIDs map[
699699
// BSON property builders (package-level, no receiver needed)
700700
// ===========================================================================
701701

702-
func buildDataGrid2Property(entry pages.PropertyTypeIDEntry, datasource pages.DataSource, attrRef string, primitiveValue string, b *MprBackend) bson.D {
702+
func buildDataGrid2Property(entry pages.PropertyTypeIDEntry, datasource pages.DataSource, attrRef string, primitiveValue string, _ *MprBackend) bson.D {
703703
var datasourceBSON any
704704
if datasource != nil {
705705
datasourceBSON = mpr.SerializeCustomWidgetDataSource(datasource)

mdl/executor/executor_connect.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ func reconnect(ctx *ExecContext) error {
6565
}
6666

6767
// Reopen connection
68+
if e.backendFactory == nil {
69+
return mdlerrors.NewBackend("reconnect", fmt.Errorf("no backend factory configured"))
70+
}
6871
b := e.backendFactory()
6972
if err := b.Connect(e.mprPath); err != nil {
7073
return mdlerrors.NewBackend("reconnect", err)

0 commit comments

Comments
 (0)