File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -255,10 +255,15 @@ data class MojiraBug(
255255 val fix_versions : List <String >
256256) {
257257 companion object {
258- fun fetch (bugId : String ): MojiraBug {
259- val url = " https://mojira.dev/api/v1/issues/$bugId "
260- val response = `java.net`.URI (url).toURL().readText()
261- return com.google.gson.Gson ().fromJson(response, MojiraBug ::class .java)
258+ fun fetch (bugId : String ): MojiraBug ? {
259+ try {
260+ val url = " https://mojira.dev/api/v1/issues/$bugId "
261+ val response = `java.net`.URI (url).toURL().readText()
262+ return com.google.gson.Gson ().fromJson(response, MojiraBug ::class .java)
263+ } catch (e: Exception ) {
264+ e.printStackTrace()
265+ return null
266+ }
262267 }
263268 }
264269}
@@ -326,6 +331,6 @@ fun parsePatchedFile(contents: String): List<PatchedFileEntry> {
326331}
327332fun getBugDescription (bugId : String ): String {
328333 val mojiraBug = MojiraBug .fetch(bugId)
329- return mojiraBug.summary
334+ return mojiraBug? .summary ? : " "
330335}
331336
You can’t perform that action at this time.
0 commit comments