Changeset 2926 in josm


Ignore:
Timestamp:
2010-02-02T23:42:49+01:00 (14 years ago)
Author:
mjulius
Message:

Fix NPE when CONTRIBUTION|LICENSE|README files are not found

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/.classpath

    r2778 r2926  
    44        <classpathentry kind="src" path="test/unit"/>
    55        <classpathentry kind="src" path="test/functional"/>
    6         <classpathentry excluding="build/|dist/|src/|test/|test/build/|test/functional/|test/unit/" including="data/|images/|presets/|styles/" kind="src" path=""/>
     6        <classpathentry excluding="build/|dist/|src/|test/|test/build/|test/functional/|test/unit/" including="CONTRIBUTION|LICENSE|README|data/|images/|presets/|styles/" kind="src" path=""/>
    77        <classpathentry kind="lib" path="lib/metadata-extractor-2.3.1-nosun.jar"/>
    88        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
  • trunk/src/org/openstreetmap/josm/data/Version.java

    r2845 r2926  
    3434     */
    3535    static public String loadResourceFile(URL resource) {
     36        if (resource == null) return null;
    3637        BufferedReader in;
    3738        String s = null;
     
    7475        Pattern p = Pattern.compile("^([^:]+):(.*)$");
    7576        for (String line: content.split("\n")) {
    76             if (line == null || line.trim().equals("")) continue;
    77             if (line.matches("^\\s*#.*$")) continue;
     77            if (line == null || line.trim().equals("")) {
     78                continue;
     79            }
     80            if (line.matches("^\\s*#.*$")) {
     81                continue;
     82            }
    7883            Matcher m = p.matcher(line);
    7984            if (m.matches()) {
Note: See TracChangeset for help on using the changeset viewer.