mirror of
https://github.com/mattermost/mattermost.git
synced 2026-08-26 13:17:29 -05:00
Fix nil context panic in TestDoSetupSessionAttributesProperties (#38123)
UpdatePropertyFields panics when passed a nil context because RequestContextWithMaster dereferences it. Use SystemCallerContext to match the other sub-tests in the same function.
This commit is contained in:
@@ -545,7 +545,7 @@ func TestDoSetupSessionAttributesProperties(t *testing.T) {
|
||||
}
|
||||
require.Len(t, trimmed, len(persisted)-1)
|
||||
field.Attrs[model.PropertyFieldAttributeOptions] = trimmed
|
||||
_, _, _, err := th.Server.propertyService.UpdatePropertyFields(nil, group.ID, []*model.PropertyField{field})
|
||||
_, _, _, err := th.Server.propertyService.UpdatePropertyFields(properties.SystemCallerContext(th.Context), group.ID, []*model.PropertyField{field})
|
||||
require.NoError(t, err)
|
||||
|
||||
before := sessionAttributeOptionIDsByName(t, sessionAttributeFieldByName(t, th, group.ID, model.SessionAttributesPropertyFieldUserAgentPlatform))
|
||||
|
||||
Reference in New Issue
Block a user