Changeset 6535 in josm for trunk/src


Ignore:
Timestamp:
2013-12-26T10:09:54+01:00 (11 years ago)
Author:
simon04
Message:

fix #9475 see #9470 - NPE on startup - java.lang.reflect.InvocationTargetException

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r6523 r6535  
    255255
    256256    /**
    257      * Prints a formated error message if logging is on. Calls {@link MessageFormat#format}
     257     * Prints a formatted error message if logging is on. Calls {@link MessageFormat#format}
    258258     * function to format text.
    259      * @param msg The formated message to print.
     259     * @param msg The formatted message to print.
    260260     * @param objects The objects to insert into format string.
    261261     * @since 6248
     
    266266
    267267    /**
    268      * Prints a formated warning message if logging is on. Calls {@link MessageFormat#format}
     268     * Prints a formatted warning message if logging is on. Calls {@link MessageFormat#format}
    269269     * function to format text.
    270      * @param msg The formated message to print.
     270     * @param msg The formatted message to print.
    271271     * @param objects The objects to insert into format string.
    272272     */
     
    276276
    277277    /**
    278      * Prints a formated informational message if logging is on. Calls {@link MessageFormat#format}
     278     * Prints a formatted informational message if logging is on. Calls {@link MessageFormat#format}
    279279     * function to format text.
    280      * @param msg The formated message to print.
     280     * @param msg The formatted message to print.
    281281     * @param objects The objects to insert into format string.
    282282     */
     
    286286
    287287    /**
    288      * Prints a formated debug message if logging is on. Calls {@link MessageFormat#format}
     288     * Prints a formatted debug message if logging is on. Calls {@link MessageFormat#format}
    289289     * function to format text.
    290      * @param msg The formated message to print.
     290     * @param msg The formatted message to print.
    291291     * @param objects The objects to insert into format string.
    292292     */
     
    302302    public static void error(Throwable t) {
    303303        error(getErrorMessage(t));
     304        t.printStackTrace();
    304305    }
    305306
     
    311312    public static void warn(Throwable t) {
    312313        warn(getErrorMessage(t));
     314        t.printStackTrace();
    313315    }
    314316
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r6534 r6535  
    7979    }
    8080
     81    @SuppressWarnings("UnusedDeclaration")
    8182    public static class Functions {
    8283
     
    270271         */
    271272        public String tag(String key) {
    272             return env.osm.get(key);
     273            return env.osm == null ? null : env.osm.get(key);
    273274        }
    274275
     
    278279        public String parent_tag(String key) {
    279280            if (env.parent == null) {
    280                 // we don't have a matched parent, so just search all referrers
    281                 for (OsmPrimitive parent : env.osm.getReferrers()) {
    282                     String value = parent.get(key);
    283                     if (value != null) {
    284                         return value;
     281                if (env.osm != null) {
     282                    // we don't have a matched parent, so just search all referrers
     283                    for (OsmPrimitive parent : env.osm.getReferrers()) {
     284                        String value = parent.get(key);
     285                        if (value != null) {
     286                            return value;
     287                        }
    285288                    }
    286289                }
Note: See TracChangeset for help on using the changeset viewer.