Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#18103 closed defect (fixed)

TypeError: Cannot read property "0" from undefined

Reported by: Famlam Owned by: team
Priority: normal Milestone: 20.02
Component: Core validator Version:
Keywords: validator typeerror opening_hours Cc: ypid23

Description

What steps will reproduce the problem?

  1. Open attached file (extract from part of the city of Utrecht, The Netherlands)
  2. Run Validator
  3. "TypeError: Cannot read property "0" from undefined"

What is the expected result?

Warning: bad opening_hours format (or something like that)

What happens instead?

"TypeError: Cannot read property "0" from undefined"

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-08-26 08:55:27 +0200 (Mon, 26 Aug 2019)
Build-Date:2019-08-26 06:57:10
Revision:15322
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15322 nl) Windows 8.1 64-Bit
OS Build number: Windows 8.1 (9600)
Memory Usage: 255 MB / 989 MB (91 MB allocated, but free)
Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) Client VM
Screen: \Display0 1600x900
Maximum Screen Size: 1600x900
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (34977)
+ changeset-viewer (22)
+ tageditor (34977)
+ turnlanes-tagging (281)
+ utilsplugin2 (35098)

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/OsmoseValidations&zip=1

Last errors/warnings:
- W: Cannot lock cache directory. Will not use disk cache
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: javax.script.ScriptException: TypeError: Cannot read property "0" from undefined in <eval> at line number 44. Oorzaak: jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "0" from undefined
- E: javax.script.ScriptException: TypeError: Cannot read property "0" from undefined in <eval> at line number 44. Oorzaak: jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "0" from undefined

Attachments (1)

buggy.osm (1.4 KB ) - added by Famlam 6 years ago.
OSM file containing the bad opening_hours tag

Download all attachments as: .zip

Change History (7)

by Famlam, 6 years ago

Attachment: buggy.osm added

OSM file containing the bad opening_hours tag

comment:1 by Don-vip, 6 years ago

opening_hours: Mo.-Fri.8:00-18:00, Sat:8:00-17:00, Sun: Closed
Error:

javax.script.ScriptException: TypeError: Cannot read property "0" from undefined in <eval> at line number 44. Cause: jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "0" from undefined
javax.script.ScriptException: TypeError: Cannot read property "0" from undefined in <eval> at line number 44
	at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470)
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:392)
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeMethod(NashornScriptEngine.java:199)
	at org.openstreetmap.josm.data.validation.tests.OpeningHourTest.getOpeningHoursWarnings(OpeningHourTest.java:291)
	at org.openstreetmap.josm.data.validation.tests.OpeningHourTest.checkOpeningHourSyntax(OpeningHourTest.java:245)
	at org.openstreetmap.josm.data.validation.tests.OpeningHourTest.checkOpeningHourSyntax(OpeningHourTest.java:214)
	at org.openstreetmap.josm.data.validation.tests.OpeningHourTest.check(OpeningHourTest.java:323)
	at org.openstreetmap.josm.data.validation.tests.OpeningHourTest.check(OpeningHourTest.java:331)
	at org.openstreetmap.josm.data.validation.Test$TagTest.visit(Test.java:128)
	at org.openstreetmap.josm.data.osm.Node.accept(Node.java:211)
	at org.openstreetmap.josm.data.validation.Test.visit(Test.java:213)
	at org.openstreetmap.josm.actions.ValidateAction$ValidationTask.realRun(ValidateAction.java:168)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: <eval>:44 TypeError: Cannot read property "0" from undefined
	at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
	at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
	at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
	at jdk.nashorn.internal.runtime.Undefined.get(Undefined.java:157)
	at jdk.nashorn.internal.scripts.Script$Recompilation$122$243003AAA$\^eval\_.opening_hours#L:44#L:44#formatWarnErrorMessage(<eval>:44)
	at jdk.nashorn.internal.scripts.Script$Recompilation$110$250211A$\^eval\_.opening_hours#L:44#L:44#getWarnings(<eval>:45)
	at jdk.nashorn.internal.scripts.Script$Recompilation$104$311873$\^eval\_.opening_hours#L:44#L:44#getWarnings-1(<eval>:46)
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
	at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:199)
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:386)
	... 17 more

comment:2 by Don-vip, 6 years ago

Cc: ypid23 added

@ypid should I create a bug report to https://github.com/opening-hours/opening_hours.js/issues?

comment:3 by Don-vip, 6 years ago

In 15328/josm:

see #18103 - fix EDT violation

comment:4 by ypid23, 6 years ago

Hi

@Don-vip: This bug is already known and not trivial. https://github.com/opening-hours/opening_hours.js/issues/86

comment:5 by simon04, 5 years ago

Resolution: fixed
Status: newclosed

Fixed via #18577 and/or #18140.

comment:6 by Don-vip, 5 years ago

Milestone: 20.02

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.