times loop functionality does not support break, throws Null Pointer Exception

Description

When attempting to break from a loop using the newer `times` functionality (https://docs.lucee.org/guides/lucee-5/times.html) you get a Null Pointer Exception. This occurs in both cfscript and tag.

Only tested on the 2 latest versions my apps are running.

<cfscript> loop times=10 { break; } </cfscript> <cfloop times=10> <cfbreak> </cfloop>

Environment

commandbox:alpine docker latest

Attachments

1
  • 11 Jun 2020, 11:18 pm

Activity

Show:

Zac Spitzer 16 August 2023 at 06:06
Edited

even simpler repo

<cfscript>     q_users = QueryNew("user");     loop query="q_users" {     } </cfscript>

can’t repo as a test case tho, but it happens for me with tomcat on 5.3.4.2 and 6.0.0.529

Zac Spitzer 23 July 2022 at 09:52

Lucee 5.3.10.28-SNAPSHOT Error (java.lang.NullPointerException) Message java.lang.NullPointerException Java Stacktrace lucee.runtime.exp.NativeException: java.lang.NullPointerException   at lucee.transformer.bytecode.statement.tag.TagLoop.getBreakLabel(TagLoop.java:846)   at lucee.transformer.bytecode.util.ASMUtil.leadFlow(ASMUtil.java:244)   at lucee.transformer.bytecode.statement.tag.TagBreak._writeOut(TagBreak.java:45)   at lucee.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:81)   at lucee.transformer.bytecode.util.ExpressionUtil.writeOut(ExpressionUtil.java:146)   at lucee.transformer.bytecode.BodyBase.writeOut(BodyBase.java:191)   at lucee.transformer.bytecode.BodyBase.writeOut(BodyBase.java:147)   at lucee.transformer.bytecode.BodyBase._writeOut(BodyBase.java:143)   at lucee.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:81)   at lucee.transformer.bytecode.statement.tag.TagLoop.writeOutTypeTimes(TagLoop.java:236)   at lucee.transformer.bytecode.statement.tag.TagLoop._writeOut(TagLoop.java:206)

Geoff Bowers 30 July 2020 at 02:24

Just got caught by this… Lucee 5.3.6.61; nothing else to add.

Pothys - MitrahSoft 12 June 2020 at 06:56

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.3-SNAPSHOT also. Using break in loop times functionality throws a NullPointerException.

Details

Assignee

Reporter

Priority

Labels

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Affects versions

Created 11 June 2020 at 23:20
Updated 17 June 2024 at 08:39

Flag notifications