Author: dmaliarevich
Date: 2009-04-16 09:30:50 -0400 (Thu, 16 Apr 2009)
New Revision: 14770
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4105, when image path is not specified NPE could
be thrown, additional check was added.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-04-16
10:19:21 UTC (rev 14769)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2009-04-16
13:30:50 UTC (rev 14770)
@@ -603,7 +603,16 @@
*/
public static String addFullPathToImgSrc(String path,
VpePageContext pageContext, boolean showUnresolvedImage) {
-
+
+ if (path == null) {
+ if (showUnresolvedImage) {
+ return FILE_PROTOCOL + SLASH + SLASH
+ + getAbsoluteResourcePath(UNRESOLVED_IMAGE_PATH).replace('\\',
'/');
+ } else {
+ return EMPTY_STRING;
+ }
+ }
+
IPath tagPath = new Path(path);
if (tagPath.isEmpty()) {
if (showUnresolvedImage) {
@@ -613,8 +622,6 @@
return path.replace('\\', '/');
}
}
-
-
String device = (tagPath.getDevice() == null ? tagPath.segment(0)
: tagPath.getDevice());