From f442492e80154dd9e5e3589c2b5280153dfa5855 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Mon, 22 Jun 2015 16:47:54 +0300 Subject: [PATCH] Fixed possible crash in file copying. --- .../com/mapswithme/maps/settings/StoragePathManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/com/mapswithme/maps/settings/StoragePathManager.java b/android/src/com/mapswithme/maps/settings/StoragePathManager.java index 7082e2ab14..f689b90c7b 100644 --- a/android/src/com/mapswithme/maps/settings/StoragePathManager.java +++ b/android/src/com/mapswithme/maps/settings/StoragePathManager.java @@ -531,8 +531,10 @@ public class StoragePathManager outputChannel.transferFrom(inputChannel, 0, inputChannel.size()); } finally { - inputChannel.close(); - outputChannel.close(); + if (inputChannel != null) + inputChannel.close(); + if (outputChannel != null) + outputChannel.close(); } }