Index: src/org/openstreetmap/josm/gui/tagging/ac/AutoCompComboBox.java
===================================================================
--- src/org/openstreetmap/josm/gui/tagging/ac/AutoCompComboBox.java	(revision 18191)
+++ src/org/openstreetmap/josm/gui/tagging/ac/AutoCompComboBox.java	(working copy)
@@ -104,7 +104,7 @@
         @Override
         public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)
                 throws BadLocationException {
-            int newLen = fb.getDocument().getLength() + string.length();
+            int newLen = fb.getDocument().getLength() + ((string == null) ? 0 : string.length());
             if (maxTextLength == -1 || newLen <= maxTextLength ||
                     // allow longer text while composing characters or it will be hard to compose
                     // the last characters before the limit
@@ -116,7 +116,7 @@
         @Override
         public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr)
                 throws BadLocationException {
-            int newLen = fb.getDocument().getLength() - length + string.length();
+            int newLen = fb.getDocument().getLength() - length + ((string == null) ? 0 : string.length());
             if (maxTextLength == -1 || newLen <= maxTextLength ||
                     // allow longer text while composing characters or it will be hard to compose
                     // the last characters before the limit
