Skip to content

Commit

Permalink
refactor: added type check for write file data
Browse files Browse the repository at this point in the history
  • Loading branch information
davidallendj committed Dec 9, 2024
1 parent 86d4abb commit 00f322c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/memstore/ciMemStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ func (m *MemStore) Get(id string, groupLabels []string) (citypes.CI, error) {
ci.CIData.UserData["write_files"] = []citypes.WriteFiles{}
}

// Make sure that the the write files are in the correct format
switch groupData.Actions["write_files"].(type) {
default:
log.Fatal().Msg("Unexpected type for write file. Check your submitted data.")
case []interface{}:
}

// Now iterate through the entries and add them to the UserData
for _, wf := range groupData.Actions["write_files"].([]interface{}) {
writeFilesEntry := citypes.WriteFiles{
Expand Down

0 comments on commit 00f322c

Please sign in to comment.