Author: dmaliarevich
Date: 2011-11-22 05:54:37 -0500 (Tue, 22 Nov 2011)
New Revision: 36526
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-9975 - fixed NPE when css url equals "\"
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 2011-11-22
10:30:28 UTC (rev 36525)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2011-11-22
10:54:37 UTC (rev 36526)
@@ -800,10 +800,9 @@
if (uri == null || !uri.isAbsolute()) {
String decodedUrl = decodeUrl(resolvedUrl);
Path path = new Path(decodedUrl);
- if (decodedUrl.startsWith("/") //$NON-NLS-1$
+ if (decodedUrl.startsWith("/") && (null !=
path.segment(0))//$NON-NLS-1$
&& path.segment(0).equals(baseFile.getProject().getName())) {
- decodedUrl = "/" //$NON-NLS-1$
- + path.removeFirstSegments(1).toPortableString();
+ decodedUrl = "/" + path.removeFirstSegments(1).toPortableString();
//$NON-NLS-1$
}
IFile file = FileUtil.getFile(decodedUrl, baseFile);
if (file != null && file.getLocation() != null) {