Use finally to close the update checker stream

This commit is contained in:
Kane York 2013-05-30 12:33:30 -05:00 committed by GJ
parent 385f8ca0b3
commit f81a763d6c

View File

@ -35,7 +35,6 @@ public class UpdateChecker {
Object o = jp.parse(isr); Object o = jp.parse(isr);
if (!(o instanceof JSONObject)) { if (!(o instanceof JSONObject)) {
isr.close();
return false; return false;
} }
@ -56,15 +55,16 @@ public class UpdateChecker {
oldVer = 0; oldVer = 0;
} }
if (oldVer < newVer) { if (oldVer < newVer) {
isr.close();
return true; return true;
} }
} }
return false; return false;
} }
catch (ParseException e) { catch (ParseException e) {
isr.close();
return false; return false;
} }
finally {
isr.close();
}
} }
} }