enonic / app-metafields

SEO Meta Fields app for Enonic XP
https://market.enonic.com/vendors/enonic/com.enonic.app.metafields
Apache License 2.0
0 stars 10 forks source link

Error on a page rendered via controller mapping #164

Closed alansemenov closed 4 months ago

alansemenov commented 4 months ago

https://developer.enonic.com/search?q=webapp

If a page is not mapped to an underlying content item but rendered via controller mapping then SEO Metafields will give an error:

Caused by: org.openjdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot get property "_path" of null
    at org.openjdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
    at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:212)
    at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:184)
    at org.openjdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:171)
    at org.openjdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkNull(NashornBottomLinker.java:258)
    at org.openjdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(NashornBottomLinker.java:69)
    at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:109)
    at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(LinkerServicesImpl.java:137)
    at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(LinkerServicesImpl.java:168)
    at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:135)
    at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(DynamicLinker.java:241)
    at org.openjdk.nashorn.internal.scripts.Script$Recompilation$1043$901AA$add_metadata.L:1#responseProcessor(com.enonic.app.metafields:/site/processors/add-metadata.js:47)
    at org.openjdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:650)
    at org.openjdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
    at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:520)
    at org.openjdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:111)
    at com.enonic.xp.script.impl.value.FunctionScriptValue.call(FunctionScriptValue.java:38)
ComLock commented 4 months ago

This probably happens because it's a site mapping, and there is no content.