Index: trunk/src/com/kitfox/svg/ImageSVG.java
===================================================================
--- trunk/src/com/kitfox/svg/ImageSVG.java	(revision 14333)
+++ trunk/src/com/kitfox/svg/ImageSVG.java	(revision 14334)
@@ -119,17 +119,14 @@
                     imageSrc = new URL(null, src.toASCIIString(), new Handler());
                 }
-                else 
-                {
-                    if (!diagram.getUniverse().isImageDataInlineOnly())
+                else if (!diagram.getUniverse().isImageDataInlineOnly())
+                {
+                    try
                     {
-                        try
-                        {
-                            imageSrc = src.toURL();
-                        } catch (Exception e)
-                        {
-                            Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
-                                "Could not parse xlink:href " + src, e);
-                            imageSrc = null;
-                        }
+                        imageSrc = src.toURL();
+                    } catch (Exception e)
+                    {
+                        Logger.getLogger(SVGConst.SVG_LOGGER).log(Level.WARNING,
+                            "Could not parse xlink:href " + src, e);
+                        imageSrc = null;
                     }
                 }
@@ -140,29 +137,31 @@
         }
 
-        diagram.getUniverse().registerImage(imageSrc);
-
-        //Set widths if not set
-        BufferedImage img = diagram.getUniverse().getImage(imageSrc);
-        if (img == null)
-        {
+        if (imageSrc != null)
+        {
+            diagram.getUniverse().registerImage(imageSrc);
+
+            //Set widths if not set
+            BufferedImage img = diagram.getUniverse().getImage(imageSrc);
+            if (img == null)
+            {
+                xform = new AffineTransform();
+                bounds = new Rectangle2D.Float();
+                return;
+            }
+
+            if (width == 0)
+            {
+                width = img.getWidth();
+            }
+            if (height == 0)
+            {
+                height = img.getHeight();
+            }
+
+            //Determine image xform
             xform = new AffineTransform();
-            bounds = new Rectangle2D.Float();
-            return;
-        }
-
-        if (width == 0)
-        {
-            width = img.getWidth();
-        }
-        if (height == 0)
-        {
-            height = img.getHeight();
-        }
-
-        //Determine image xform
-        xform = new AffineTransform();
-        xform.translate(this.x, this.y);
-        xform.scale(this.width / img.getWidth(), this.height / img.getHeight());
-
+            xform.translate(this.x, this.y);
+            xform.scale(this.width / img.getWidth(), this.height / img.getHeight());
+        }
         bounds = new Rectangle2D.Float(this.x, this.y, this.width, this.height);
     }
@@ -337,14 +336,14 @@
                 URI src = sty.getURIValue(getXMLBase());
 
-                URL newVal;
+                URL newVal = null;
                 if ("data".equals(src.getScheme()))
                 {
                     newVal = new URL(null, src.toASCIIString(), new Handler());
-                } else
+                } else if (!diagram.getUniverse().isImageDataInlineOnly())
                 {
                     newVal = src.toURL();
                 }
 
-                if (!newVal.equals(imageSrc))
+                if (newVal != null && !newVal.equals(imageSrc))
                 {
                     imageSrc = newVal;
