fix NPE rendering reference

This commit is contained in:
Grahame Grieve 2024-11-22 22:50:59 +11:00
parent 44189e9bde
commit aa128248f6
1 changed files with 16 additions and 12 deletions

View File

@ -846,6 +846,7 @@ public abstract class ResourceRenderer extends DataRenderer {
if (!Utilities.noString(r.getId())) { if (!Utilities.noString(r.getId())) {
if (!context.isSecondaryLang()) { if (!context.isSecondaryLang()) {
String sid = r.getScopedId(); String sid = r.getScopedId();
if (sid != null) {
if (!context.hasAnchor(sid)) { if (!context.hasAnchor(sid)) {
context.addAnchor(sid); context.addAnchor(sid);
x.an(context.prefixAnchor(sid)); x.an(context.prefixAnchor(sid));
@ -856,8 +857,10 @@ public abstract class ResourceRenderer extends DataRenderer {
x.an(context.prefixAnchor(sid)); x.an(context.prefixAnchor(sid));
} }
} }
}
if (context.getLocale() != null) { if (context.getLocale() != null) {
String langSuffix = "-"+context.getLocale().toLanguageTag(); String langSuffix = "-"+context.getLocale().toLanguageTag();
if (r.getScopedId() != null) {
String sid = r.getScopedId()+langSuffix; String sid = r.getScopedId()+langSuffix;
if (!context.hasAnchor(sid)) { if (!context.hasAnchor(sid)) {
context.addAnchor(sid); context.addAnchor(sid);
@ -865,6 +868,7 @@ public abstract class ResourceRenderer extends DataRenderer {
} }
} }
} }
}
if (context.isTechnicalMode()) { if (context.isTechnicalMode()) {
RenderingStatus status = new RenderingStatus(); RenderingStatus status = new RenderingStatus();