Skip to content

Commit

Permalink
Fix crash reading track when it doesn't exist (#816)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <[email protected]>
  • Loading branch information
SUPERCILEX committed Jun 3, 2020
1 parent 6b49bc6 commit 3545c6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[*]
charset = utf-8
end_of_line = crlf
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ internal class DefaultPlayPublisher(
}

override fun getTrack(editId: String, track: String): Track {
return publisher.edits().tracks().get(appId, editId, track).execute()
return try {
publisher.edits().tracks().get(appId, editId, track).execute()
} catch (e: GoogleJsonResponseException) {
if (e has "notFound") {
Track().setTrack(track)
} else {
throw e
}
}
}

override fun listTracks(editId: String): List<Track> {
Expand Down
Empty file modified testapp/gradlew
100644 → 100755
Empty file.

0 comments on commit 3545c6a

Please sign in to comment.