Skip to content
Snippets Groups Projects
Commit 4dcf72e1 authored by srosse's avatar srosse
Browse files

OO-2482: prevent NPE in uri calculation method

parent 261eaa8e
No related branches found
No related tags found
No related merge requests found
...@@ -616,14 +616,11 @@ public class AssessmentRenderFunctions { ...@@ -616,14 +616,11 @@ public class AssessmentRenderFunctions {
</xsl:function> </xsl:function>
*/ */
public static final String convertLink(AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, String uri) { public static final String convertLink(AssessmentObjectComponent component, ResolvedAssessmentItem resolvedAssessmentItem, String uri) {
if(uri.startsWith("http:") || uri.startsWith("https:") || uri.startsWith("mailto:")) { if(uri != null && uri.startsWith("http:") || uri.startsWith("https:") || uri.startsWith("mailto:")) {
return uri; return uri;
} }
String relativePath = component.relativePathTo(resolvedAssessmentItem); String relativePath = component.relativePathTo(resolvedAssessmentItem);
uri = component.getMapperUri() + "/file?href=" + relativePath + uri; return component.getMapperUri() + "/file?href=" + relativePath + (uri == null ? "" : uri);
return uri;
} }
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment