Index: trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 3908)
+++ trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java	(revision 3909)
@@ -1197,7 +1197,7 @@
 
             // Draw attribution logo
-            int imgWidth = attrImage.getWidth(this);
             if(attrImage != null) {
                 int x = 2;
+                int imgWidth = attrImage.getWidth(this);
                 int height = attrImage.getHeight(this);
                 int y = termsTextY - height - textHeight - 5;
