xmlgraphics-batik-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r568875 - /xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java
Date Thu, 23 Aug 2007 08:12:12 GMT
Author: cam
Date: Thu Aug 23 01:12:11 2007
New Revision: 568875

URL: http://svn.apache.org/viewvc?rev=568875&view=rev
Log:
Defend against an NPE if the class isn't in a jar.

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java?rev=568875&r1=568874&r2=568875&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/Version.java Thu Aug 23 01:12:11 2007
@@ -67,7 +67,11 @@
      * </p>
      */
     public static String getVersion() {
-        String version = Version.class.getPackage().getImplementationVersion();
+        Package pkg = Version.class.getPackage();
+        String version = null;
+        if (pkg != null) {
+            version = pkg.getImplementationVersion();
+        }
         String headURL = "$HeadURL$";
         String prefix = "$HeadURL: ";
         String suffix = "/sources/org/apache/batik/Version.java $";



Mime
View raw message