diff --git a/app/src/main/java/com/limelight/computers/ComputerManagerService.java b/app/src/main/java/com/limelight/computers/ComputerManagerService.java index 72f4a3bb..a9c0873a 100644 --- a/app/src/main/java/com/limelight/computers/ComputerManagerService.java +++ b/app/src/main/java/com/limelight/computers/ComputerManagerService.java @@ -612,9 +612,19 @@ public class ComputerManagerService extends Service { List list = NvHTTP.getAppListByReader(new StringReader(appList)); if (appList != null && !appList.isEmpty() && !list.isEmpty()) { // Open the cache file - FileOutputStream cacheOut = CacheHelper.openCacheFileForOutput(getCacheDir(), "applist", computer.uuid.toString()); - CacheHelper.writeStringToOutputStream(cacheOut, appList); - cacheOut.close(); + FileOutputStream cacheOut = null; + try { + cacheOut = CacheHelper.openCacheFileForOutput(getCacheDir(), "applist", computer.uuid.toString()); + CacheHelper.writeStringToOutputStream(cacheOut, appList); + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (cacheOut != null) { + cacheOut.close(); + } + } catch (IOException e) {} + } // Update the computer computer.rawAppList = appList;