[libbluray-devel] Check for null

hpi1 git at videolan.org
Sun Feb 21 17:55:08 CET 2016


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Nov 19 15:14:32 2015 +0200| [928606d3be3c27ad1697ecd8dd2ca278491699dc] | committer: hpi1

Check for null

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

 src/libbluray/bdj/java/java/awt/BDGraphicsBase.java |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
index f7e60f7..24aa2c8 100644
--- a/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
+++ b/src/libbluray/bdj/java/java/awt/BDGraphicsBase.java
@@ -170,7 +170,11 @@ abstract class BDGraphicsBase extends Graphics2D implements ConstrainableGraphic
     }
 
     public FontMetrics getFontMetrics(Font font) {
-        return BDFontMetrics.getFontMetrics(font);
+        if (font != null) {
+            return BDFontMetrics.getFontMetrics(font);
+        }
+        logger.error("getFontMetrics(null) from " + Logger.dumpStack());
+        return null;
     }
 
     public void setColor(Color c) {



More information about the libbluray-devel mailing list