Ignore:
Timestamp:
2020-10-11T21:29:57+02:00 (4 years ago)
Author:
simon04
Message:

fix #19914 - Deal with DateTimeException when using DateUtils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java

    r17153 r17166  
    88import java.io.StringReader;
    99import java.text.Normalizer;
     10import java.time.DateTimeException;
    1011import java.util.ArrayList;
    1112import java.util.Arrays;
     
    201202                                // if min timestamp is empty: use lowest possible date
    202203                                minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime();
    203                             } catch (UncheckedParseException ex) {
     204                            } catch (UncheckedParseException | DateTimeException ex) {
    204205                                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA1), ex);
    205206                            }
     
    207208                                // if max timestamp is empty: use "now"
    208209                                maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime();
    209                             } catch (UncheckedParseException ex) {
     210                            } catch (UncheckedParseException | DateTimeException ex) {
    210211                                throw new SearchParseError(tr("Cannot parse timestamp ''{0}''", rangeA2), ex);
    211212                            }
Note: See TracChangeset for help on using the changeset viewer.