From 2d6160c843ee654201317af556625b61391ca347 Mon Sep 17 00:00:00 2001 From: konohakesh <34960596+konohakesh@users.noreply.github.com> Date: Tue, 18 Dec 2018 17:12:24 +0530 Subject: [PATCH] Merge PR-1983 with master (#1983) --- .../fr/free/nrw/commons/utils/ContributionUtils.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/utils/ContributionUtils.java b/app/src/main/java/fr/free/nrw/commons/utils/ContributionUtils.java index eb7cec957..7d080f4fc 100644 --- a/app/src/main/java/fr/free/nrw/commons/utils/ContributionUtils.java +++ b/app/src/main/java/fr/free/nrw/commons/utils/ContributionUtils.java @@ -112,9 +112,9 @@ public class ContributionUtils { out = new FileOutputStream(new File(destinationFilename)); byte[] buf = new byte[1024]; - int len; - while ((len=in.read(buf)) > 0) { - out.write(buf, 0, len); + int length; + while ((length = in.read(buf)) > 0) { + out.write(buf, 0, length); } } catch (FileNotFoundException e) { e.printStackTrace(); @@ -123,6 +123,11 @@ public class ContributionUtils { } finally { try { if (out != null) out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + + try { if (in != null) in.close(); } catch (IOException e) { e.printStackTrace();