Author: vyemialyanchyk
Date: 2007-12-14 07:51:47 -0500 (Fri, 14 Dec 2007)
New Revision: 5312
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1243
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2007-12-14
12:50:44 UTC (rev 5311)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2007-12-14
12:51:47 UTC (rev 5312)
@@ -72,7 +72,7 @@
file = ((IFileEditorInput)input).getFile();
}
- if (file != null) {
+ if (null != file) {
ResourceReference resourceReference = null;
if ("/".equals(tagValue.substring(0, 1))) {
resourceReference = pageContext.getRuntimeAbsoluteFolder(file);
@@ -86,13 +86,15 @@
location = resourceReference.getLocation();
}
- if (location == null) {
+ if (null == location && null != file.getLocation()) {
location = file.getLocation().toFile().getParent();
}
- File f = new File(location + File.separator + tagValue);
- if (f.exists()) {
- return new VpeValue(getPrefix() + f.getPath());
+ if (null != location) {
+ File f = new File(location + File.separator + tagValue);
+ if (f.exists()) {
+ return new VpeValue(getPrefix() + f.getPath());
+ }
}
}
}