Skip to content

Commit 3831b52

Browse files
committed
Use try with resources
1 parent adb3efe commit 3831b52

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/common/CrashlyticsController.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,11 @@ String getVersionControlInfo() throws IOException {
639639
}
640640

641641
// Fallback to reading the file
642-
InputStream is = getResourceAsStream(META_INF_FOLDER + VERSION_CONTROL_INFO_FILE);
643-
if (is != null) {
644-
Logger.getLogger().d("Read version control info from file");
645-
return Base64.encodeToString(readResource(is), 0);
642+
try (InputStream is = getResourceAsStream(META_INF_FOLDER + VERSION_CONTROL_INFO_FILE)) {
643+
if (is != null) {
644+
Logger.getLogger().d("Read version control info from file");
645+
return Base64.encodeToString(readResource(is), 0);
646+
}
646647
}
647648

648649
Logger.getLogger().i("No version control information found");

0 commit comments

Comments
 (0)