[libbluray-devel] Check for null

hpi1 git at videolan.org
Mon Oct 27 10:48:56 CET 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Oct 27 11:47:43 2014 +0200| [10c6373795145bd377cdd9183349f2d2ec602a00] | committer: hpi1

Check for null

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

 src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java b/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java
index b4b07fa..153a8c1 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/peer/BDComponentPeer.java
@@ -114,7 +114,10 @@ public abstract class BDComponentPeer implements ComponentPeer
     public Graphics getGraphics() {
         Component parent = component.getParent();
         if (parent != null) {
-            return parent.getGraphics().create(location.x, location.y, size.width, size.height);
+            Graphics g = parent.getGraphics();
+            if (g != null) {
+                return g.create(location.x, location.y, size.width, size.height);
+            }
         }
         logger.error("getGraphics(): no parent !");
         throw new Error();



More information about the libbluray-devel mailing list