Connexys URL

An error occurred while processing the template.
The following has evaluated to null or missing:
==> journalArticle  [in template "10155#10193#VACATURE-APPLY-TEMPLATE" at line 50, column 7]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if (journalArticle.getDDMStructureKe...  [in template "10155#10193#VACATURE-APPLY-TEMPLATE" at line 50, column 1]
----
1<#assign serviceContext = staticUtil["com.liferay.portal.kernel.service.ServiceContextThreadLocal"].getServiceContext()> 
2<#assign httpServletRequest = serviceContext.getRequest()> 
3			 
4<#assign url = httpServletRequest.getAttribute("CURRENT_URL")> 
5 
6<#assign p_f_taal = httpUtil.decodeURL(httpUtil.getParameter(url, "p_f_taal", false)) /> 
7<#assign p_sfw_id = httpUtil.decodeURL(httpUtil.getParameter(url, "p_sfw_id", false)) /> 
8<#assign p_advertentie_id = httpUtil.decodeURL(httpUtil.getParameter(url, "p_advertentie_id", false)) /> 
9<#assign p_pub_id =httpUtil.decodeURL(httpUtil.getParameter(url, "p_pub_id", false))/> 
10<#assign vacancyId = httpUtil.decodeURL(httpUtil.getParameter(url, "regurl", false)) /> 
11 
12<#assign jobRegistrationURL = ""/> 
13 
14<#if (validator.isNotNull(vacancyId))> 
15	 
16	<#attempt> 
17	 
18		<#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")> 
19		<#assign journalArticle = journalArticleService.getLatestArticle(vacancyId?number)> 
20		 
21		<#if validator.isNotNull(journalArticle) > 
22			<#assign content = journalArticle.getContent()> 
23			<#assign doc = saxReaderUtil.read(content)> 
24			 
25			<#assign jobRegistrationURL =''> 
26			 
27			<#if (journalArticle.getDDMStructureKey() == "VACATURE-EASYCRUIT") > 
28				<#assign xPathQuery = "/root/dynamic-element[@name='vacancyID']/dynamic-element[@name='departmentID']/dynamic-element[@name='applicationURL']/dynamic-content" > 
29	                <#if doc.selectSingleNode(xPathQuery)?? >  
30	                    <#assign node = doc.selectSingleNode(xPathQuery)>        
31	                    <#if validator.isNotNull(node.getText())> 
32	                        <#assign jobRegistrationURL=node.getText()> 
33	                    </#if> 
34	                </#if> 
35			<#else> 
36				<#assign xPathQuery = "/root/dynamic-element[@name='vacancyId']/dynamic-element[@name='Publication_Id']/dynamic-element[@name='RegistrationLink_Language']/dynamic-element[@name='RegistrationLink']/dynamic-content" > 
37					<#if doc.selectSingleNode(xPathQuery)?? >  
38						<#assign node = doc.selectSingleNode(xPathQuery)>		 
39						<#if validator.isNotNull(node.getText())> 
40							<#assign jobRegistrationURL=node.getText()> 
41						</#if> 
42					</#if> 
43			</#if> 
44		</#if> 
45	 
46	<#recover> 
47	</#attempt> 
48</#if> 
49 
50<#if (journalArticle.getDDMStructureKey() == "VACATURE-EASYCRUIT") > 
51	 
52	<#assign backUrl =''/> 
53             
54	<#if httpServletRequest.getHeader("referer")??> 
55	    <#assign backUrl =  httpServletRequest.getHeader("referer")/> 
56	</#if> 
57	 
58	<#if validator.isNotNull(backUrl) && portalUtil.escapeRedirect(backUrl)?? && validator.isNotNull(portalUtil.escapeRedirect(backUrl))> 
59	    <div class="wcl-display-page vacature-detail-page vacature-apply-page"> 
60	<#else> 
61	    <div class="wcl-display-page vacature-detail-page vacature-apply-page no-back-button"> 
62	</#if> 
63	 
64    <div class="body"> 
65        <div class="detail-left-content"> 
66            <#if validator.isNotNull(backUrl) && portalUtil.escapeRedirect(backUrl)?? && validator.isNotNull(portalUtil.escapeRedirect(backUrl))> 
67                <span class="bacx-button"><a class="button" href="${htmlUtil.escapeHREF(portalUtil.escapeRedirect(backUrl))}">Terug</a></span> 
68            </#if> 
69        </div> 
70 
71        <div class="detail-middle-content vacature-iframe easycruit-vacature-iframe"> 
72            <div class="asset-title keyword-title" >Solliciteren</div> 
73	            <#if validator.isNotNull(jobRegistrationURL)> 
74	                <iframe src="${jobRegistrationURL}" width="100%" frameBorder="0" height="2500" id="vacancyApply" scrolling="yes"></iframe> 
75	            </#if> 
76	        </div> 
77	    </div> 
78	</div> 
79 
80<#else> 
81 
82	 <#if validator.isNull(p_sfw_id) > 
83	    <#assign p_sfw_id="770" /> 
84	 </#if> 
85	  
86	<#assign backUrl =''/> 
87				 
88	<#if httpServletRequest.getHeader("referer")??> 
89		<#assign backUrl =  httpServletRequest.getHeader("referer")/> 
90	</#if> 
91	 
92	<#if validator.isNotNull(backUrl) && portalUtil.escapeRedirect(backUrl)?? && validator.isNotNull(portalUtil.escapeRedirect(backUrl))> 
93		<div class="wcl-display-page vacature-detail-page vacature-apply-page"> 
94	<#else> 
95		<div class="wcl-display-page vacature-detail-page vacature-apply-page no-back-button"> 
96	</#if> 
97		 
98	<div class="body"> 
99		<div class="detail-left-content"> 
100			 
101			<#if validator.isNotNull(backUrl) && portalUtil.escapeRedirect(backUrl)?? && validator.isNotNull(portalUtil.escapeRedirect(backUrl))> 
102				<span class="bacx-button"><a class="button" href="${htmlUtil.escapeHREF(portalUtil.escapeRedirect(backUrl))}">Terug</a></span> 
103			</#if> 
104		</div> 
105		<div class="detail-middle-content vacature-iframe"> 
106		    <div class="asset-title keyword-title" >Solliciteren</div> 
107		     
108			    <#if validator.isNotNull(jobRegistrationURL)> 
109			    	<#if jobRegistrationURL?starts_with("https://www.connexys.nl") || jobRegistrationURL?starts_with("https://acceptatie.connexys.nl")> 
110						<iframe src="${jobRegistrationURL}" width="100%" frameBorder="0" height="1800" id="vacancyApply" scrolling="yes"></iframe> 
111					</#if> 
112			    <#elseif validator.isNotNull(p_advertentie_id)> 
113					<iframe src="${(baseUrl.getData())!}?p_sfw_id=${(htmlUtil.escapeHREF(p_sfw_id))!}&adv_adv_id=${(htmlUtil.escapeHREF(p_advertentie_id))!}&adv_pub_id=${(htmlUtil.escapeHREF(p_pub_id))!}&adv_taal=${(htmlUtil.escapeHREF(p_f_taal))!}&p_taal=${(htmlUtil.escapeHREF(p_f_taal))!}" width="100%" frameBorder="0" height="1800" id="vacancyApply" scrolling="yes" style="margin-top:25px;"></iframe> 
114	            </#if> 
115			</div> 
116		</div> 
117	</div> 
118</#if>