Changeset 2926 in josm for trunk/src


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.