We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2a4fb0 commit 494e65bCopy full SHA for 494e65b
Sources/SwiftyCM/game.swift
@@ -21,7 +21,10 @@ public struct Game {
21
/// - Parameter id: The ID of the game on SCM
22
/// - Throws: `SCMError`
23
public init(_ id: String) throws {
24
- self.id = id;
+ guard let intVal = Int(id) else {
25
+ throw SCMError.otherApiError;
26
+ }
27
+ self.id = String(intVal);
28
guard let e = performGetRequest(url: "https://smashcustommusic.net/json/game/\(self.id)") else {
29
throw SCMError.httpRequestError
30
};
@@ -73,4 +76,4 @@ public struct GameListGameField {
73
76
throw SCMError.otherApiError
74
77
}
75
78
-}
79
+}
0 commit comments