Skip to content

ShowEachLanguage=1 parameter and TemplateInformation gives nullreference exception #8

@AndreasKarlsen

Description

@AndreasKarlsen

I have created a report with a scanner based on ASR.Reports.Items.QueryScanner, using the query Query=./descendant-or-self::*|Root={Root}|ShowEachLanguage=1.
It returns the results as expected with the viewers ItemViewer or ItemBasic, however, if I use TemplateInformation, I get the following null reference exception with the following stacktrace:

[NullReferenceException: Object reference not set to an instance of an object.]
   ASR.Reports.Items.ItemViewer.getColumnText(String name, Item itemElement) +1233
   ASR.Reports.Items.ItemViewer.Display(DisplayElement dElement) +294
   ASR.Interface.Report.IntializeDisplayElement(Object resultItem) +130
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +222
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +249
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +105
   ASR.Interface.Report.DisplayElements(Int32 start, Int32 count) +204
   ASR.App.MainForm.PopulateItemList(Int32 start, Int32 count) +280
   ASR.App.MainForm.RunFinished(Message message) +45

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Web.UI.Sheer.BaseForm.HandleMessage(Message message) +784
   ASR.App.MainForm.HandleMessage(Message message) +458
   Sitecore.Shell.Framework.Commands.MessageCommand.Execute(CommandContext context) +611
   Sitecore.Web.UI.Sheer.ClientPage.Dispatch(String command) +192
   Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent() +124
   Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) +825
   System.Web.UI.Control.PreRenderRecursiveInternal() +107
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7675

I can see, that it happens in the following file, but I cannot identify why:
https://github.com/Sitecore/AdvancedSystemReporter/blob/master/Reports/Viewers/ItemViewer.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions