                 <div class="whoops__stacktrace_panel">
                     <ul class="stacktrace__list">
                         <cfset root = expandPath( "/" ) />
-                        <cfloop array="#local.e.TagContext#" index="i" item="instance">
-                            <li id="stack#stackFrames - i + 1#" class="stacktrace <cfif i == 1>stacktrace--active</cfif>">
+                        <cfloop from="1" to="#arrayLen( local.e.TagContext )#" index="i">
+                            <cfset instance = local.e.TagContext[ i ] />
+                            <li id="stack#stackFrames - i + 1#" class="stacktrace <cfif i EQ 1>stacktrace--active</cfif>">
                                 <span class="badge">#stackFrames - i + 1#</span>
                                 <div class="stacktrace__info">
                                     <h3 class="stacktrace__location">
                                         #replace( instance.template, root, "" )#:<span class="stacktrace__line-number">#instance.line#</span>
                                     </h3>
-                                    <h4 class="stacktrace__code">
-                                        #HTMLEditFormat( strLimit( instance.codePrintPlain, 70 ) )#
-                                    </h4>
+                                    <cfif structKeyExists( instance, "codePrintPlain" )>
+                                        <h4 class="stacktrace__code">
+                                            #HTMLEditFormat( strLimit( instance.codePrintPlain, 70 ) )#
+                                        </h4>
+                                    </cfif>
                                 </div>
                             </li>
                         </cfloop>

                        <h2>Headers</h2>
                        <cfdump var="#getHttpRequestData().headers#" top="2" expand="false" />
                    </div>
                    <div>
                        <h2>session</h2>
                        <cfdump var="#session#" top="2" expand="false" />
                    </div>
                    <div>
                        <h2>application</h2>
                        <cfdump var="#application#" top="2" expand="false" />

<cfscript>
    if ( ! structKeyExists( variables, "strLimit" ) ) {
        function strLimit( str, limit, ending = "..." ) {
            if ( len( str ) <= limit ) {
                return str;
            }
            return mid( str, 1, limit ) & ending;
        }
    }
    
    if ( ! structKeyExists( variables, "isScriptFile" ) ) {
        function isScriptFile( path ) {
            return application.wirebox.getInstance(
                name = "File@CFMLParser",
                initArguments = { path = path }
            ).isScript();
        }
    }
</cfscript>

