Skip to content

Commit c3d4b09

Browse files
committed
Fixing Bad File descriptor IOException to avoid app crashes.
1 parent 747598f commit c3d4b09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firebase-installations/src/main/java/com/google/firebase/installations/CrossProcessLock.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ static CrossProcessLock acquire(Context appContext, String lockName) {
5151
// This method blocks until it can retrieve the lock.
5252
lock = channel.lock();
5353
return new CrossProcessLock(channel, lock);
54-
} catch (IOException e) {
54+
} catch (IOException | Error e) {
5555
// Certain conditions can cause file locking to fail, such as out of disk or bad permissions.
5656
// In any case, the acquire will fail and return null instead of a held lock.
57+
// NOTE: In Java 7 & 8, FileKey creation failure wraps IOException into Error.
5758
Log.e(TAG, "encountered error while creating and acquiring the lock, ignoring", e);
5859

5960
// Clean up any dangling resources

0 commit comments

Comments
 (0)