Changeset 17076 in josm


Ignore:
Timestamp:
2020-09-30T00:37:18+02:00 (5 months ago)
Author:
Don-vip
Message:

fix #19860 - prevent illegal state to raise an NPE at JOSM startup on macOS

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java

    r14273 r17076  
    5050
    5151    private void readCurrentVersion() {
    52         int testedVersion = getTestedVersion();
     52        try {
     53            int testedVersion = getTestedVersion();
    5354
    54         if (testedVersion < 0) {
    55             SwingUtilities.invokeLater(this::displayError);
    56         } else if (josmVersion < testedVersion) {
    57             SwingUtilities.invokeLater(() -> displayOutOfDate(testedVersion));
    58         } else {
    59             SwingUtilities.invokeLater(this::displayUpToDate);
     55            if (testedVersion < 0) {
     56                SwingUtilities.invokeLater(this::displayError);
     57            } else if (josmVersion < testedVersion) {
     58                SwingUtilities.invokeLater(() -> displayOutOfDate(testedVersion));
     59            } else {
     60                SwingUtilities.invokeLater(this::displayUpToDate);
     61            }
     62        } catch (RuntimeException e) {
     63            Logging.error(e);
    6064        }
    6165    }
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r16553 r17076  
    537537     */
    538538    public static HttpClient create(URL url, String requestMethod) {
     539        if (factory == null) {
     540            throw new IllegalStateException("HTTP factory has not been set");
     541        }
    539542        return factory.create(url, requestMethod)
    540543                // #18812: specify `Accept=*/*` to prevent Java from adding `Accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2`
Note: See TracChangeset for help on using the changeset viewer.