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,22 +846,26 @@ public abstract class ResourceRenderer extends DataRenderer {
if (!Utilities.noString(r.getId())) {
if (!context.isSecondaryLang()) {
String sid = r.getScopedId();
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
}
sid = "hc"+sid;
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
if (sid != null) {
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
}
sid = "hc"+sid;
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
}
}
}
if (context.getLocale() != null) {
String langSuffix = "-"+context.getLocale().toLanguageTag();
String sid = r.getScopedId()+langSuffix;
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
if (r.getScopedId() != null) {
String sid = r.getScopedId()+langSuffix;
if (!context.hasAnchor(sid)) {
context.addAnchor(sid);
x.an(context.prefixAnchor(sid));
}
}
}
}