Index: trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 14560)
+++ trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 14561)
@@ -2009,5 +2009,5 @@
                 }
             };
-        } catch (ParseException e) {
+        } catch (ParseException | IllegalArgumentException e) {
             throw new SearchParseError(tr("Failed to parse MapCSS selector"), e);
         }
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 14560)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java	(revision 14561)
@@ -501,4 +501,16 @@
 
     /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17112">Bug #17112</a>.
+     * @throws SearchParseError always
+     */
+    @Test(expected = SearchParseError.class)
+    public void testTicket17112() throws SearchParseError {
+        SearchSetting setting = new SearchSetting();
+        setting.mapCSSSearch = true;
+        setting.text = "w"; // partial input
+        SearchCompiler.compile(setting);
+    }
+
+    /**
      * Test empty values.
      * @throws SearchParseError never
