[libbluray-devel] Fix null checks

hpi1 git at videolan.org
Mon Sep 1 14:07:29 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Aug 27 12:33:05 2014 +0300| [8124bcb3a0d52ec7ad4799ef99a035fe5a818252] | committer: hpi1

Fix null checks

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=8124bcb3a0d52ec7ad4799ef99a035fe5a818252
---

 src/libbluray/bdj/java/java/io/FileInputStream.java |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/libbluray/bdj/java/java/io/FileInputStream.java b/src/libbluray/bdj/java/java/io/FileInputStream.java
index aa74257..464e42c 100644
--- a/src/libbluray/bdj/java/java/io/FileInputStream.java
+++ b/src/libbluray/bdj/java/java/io/FileInputStream.java
@@ -177,14 +177,16 @@ public class FileInputStream extends InputStream
 
         available = 0;
 
-        if (fd != null && fd.slave != null) {
-            fd.slave.close();
-            return;
-        }
+        if (fd != null) {
+            if (fd.slave != null) {
+                fd.slave.close();
+                return;
+            }
 
-        int n = fd.decrementAndGetUseCount();
-        if (n > 0 && !force) {
-            return;
+            int n = fd.decrementAndGetUseCount();
+            if (n > 0 && !force) {
+                return;
+            }
         }
 
         close0();



More information about the libbluray-devel mailing list