Skip to content

Commit

Permalink
fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Jan 15, 2025
1 parent fcd3161 commit 4bc7c7f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
12 changes: 12 additions & 0 deletions Lambdas/GHHooks/EventHandler/Requester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ struct GuildMember {
var uiAvatarURL: String?
var userId: UserSnowflake?
var roles: [RoleSnowflake]

init(
uiName: String? = nil,
uiAvatarURL: String? = nil,
userId: UserSnowflake? = nil,
roles: [RoleSnowflake] = []
) {
self.uiName = uiName
self.uiAvatarURL = uiAvatarURL
self.userId = userId
self.roles = roles
}
}

struct CodeOwners: CustomStringConvertible {
Expand Down
21 changes: 15 additions & 6 deletions Tests/PennyTests/Fake/FakeRequester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ struct FakeRequester: GenericRequester {
case "54685446":
return .init(
uiName: "MahdiBM",
uiAvatarURL: nil,
userId: "290483761559240704",
roles: []
userId: "290483761559240704"
)
case "69189821":
return .init(
uiName: "Paul",
uiAvatarURL: nil,
userId: "409376125995974666",
roles: []
userId: "409376125995974666"
)
case "1130717":
return .init(
uiName: "Gwynne",
userId: "684888401719459858"
)
case "9938337":
return .init(
uiName: "0xTim",
userId: "432065887202181142"
)
/// Explicitly add github user ids with no registered discord member to here:
case "11927376", "3184228", "27312159", "624238", "49933115", "31141451", "54376466", "49699333":
return nil
default:
fatalError("Unhandled githubID: \(githubID)")
}
Expand Down

0 comments on commit 4bc7c7f

Please sign in to comment.