Skip to content

Commit

Permalink
Fixed stupid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackzzila committed Oct 15, 2016
1 parent 81efe31 commit 6629423
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/src/objects/Game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ class Game extends _BaseObj {

Game._new(Client client, Map<String, dynamic> data) : super(client) {
this.name = data['name'];
print(data['type'] is String);
this.type = data['type'];
this.url = data['url'];
if (data['type'] is int) {
this.type = data['type'];
} else if (data['type'] is String) {
try {
this.type = int.parse(data['type']);
} catch(err) {
this.type = null;
}
}
}
}

0 comments on commit 6629423

Please sign in to comment.