G'day
Consider this code:

<cfset a = arrayNew(1)>
<cfset a[1] = "tahi">
<cfset a[2] = "rua">
<cfset a[3] = "toru">
<cfset a[4] = "wha">

<cfset b = f(a)>

<cffunction name="f" returntype="boolean">
        <cfargument name="a" type="array" required="true">
        <cfreturn false>
</cffunction>

It works fine.  It doesn't do anything, but it works.  This is a
dramatically simplified repro case, needless to say.

Now: comment-out any of the first three array element assignments.  Re-
run code.

I get this error:

BlueDragon Internal Server Error
The page you were executing caused an internal BlueDragon server error
Request /misc/incompat/udf.cfm
File Trace      C:/webroots/openbd/misc/incompat/udf.cfm

Type    Internal
Tag Context     CFSET (C:/webroots/openbd/misc/incompat/udf.cfm, Line=7,
Column=1)
Source

4 : <!--- <cfset a[3] = "toru"> --->
5 : <cfset a[4] = "wha">
6 :
7 : <cfset b = f(a)>
8 :

^ Snippet from underlying CFML source
Stack Trace

java.lang.NullPointerException
        at com.naryx.tagfusion.cfm.engine.cfArrayData.copy(Unknown Source)
        at
com.naryx.tagfusion.cfm.parser.CFFunctionExpression.evaluateArgument(Unknown
Source)


I get a similar error, as it happens, on BD.NET:

java.lang.NullPointerException: Object reference not set to an
instance of an object.
   at com.naryx.tagfusion.cfm.engine.cfArrayData.copy()
   at
com.naryx.tagfusion.expression.compile.CFFunctionExpression.evaluateArgument(CFContext
_context, CFExpression _argExp, Boolean cfcMethod)
   at
com.naryx.tagfusion.expression.compile.CFFunctionExpression.processUDFArguments(CFContext
_context, userDefinedFunction _function)


Note that making the argument type=any or not specifying a type at all
does not help.

Needless to say, an array with missing elements should still work as
an array, yes?

Shall I raise this as a bug?

I guess I could google the answer for this, but does anyone - offhand
- know if there is a publicly accessible bug tracker for BD.NET?

Cheers.

--
Adam

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 official manual: http://www.openbluedragon.org/manual/
 Ready2Run CFML http://www.openbluedragon.org/openbdjam/

 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to