Declined
Last Updated: 15 Jun 2022 12:59 by ADMIN
Vicente
Created on: 10 Jun 2022 14:52
Category: UI for Blazor
Type: Bug Report
1
FileManager

Hi good morning. I am implementing a FileManager control, but by business logic only certain users have permission to rename files. So in the onEdit method I validate the permission and if it doesn't have it I send a DialogFactory and after that I send an args.IsCancelled = true. And at the end of the event if I click on another item (file) inside the folder. throw an exception:


public async Task OnEdit(FileManagerEditEventArgs args)
    {
        Dialogs.AlertAsync(message, "FileManager");
        args.IsCancelled = true;
    }

 

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Extensions.ReflectionExtensions.GetPropertyValue(Object target, String propertyName)
   at Telerik.Blazor.Components.TelerikFileManager`1[[XXX.WASM.Shared.HierarchicalFileEntry, XXX.WASM.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ConvertToFileEntry(Object dataItem)
   at Telerik.Blazor.Components.FileManager.FileView.FileManagerFileViewBase`1[[XXX.WASM.Shared.HierarchicalFileEntry, XXX.WASM.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].ConvertToFileEntry(Object dataItem)
   at Telerik.Blazor.Components.FileManager.FileView.FileManagerListFileView`1.<>c__DisplayClass17_2[[XXX.WASM.Shared.HierarchicalFileEntry, XXX.WASM.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<BuildRenderTree>b__8(RenderTreeBuilder __builder3)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Telerik.Blazor.Components.ListView.ListViewItem`1[[XXX.WASM.Shared.HierarchicalFileEntry, XXX.WASM.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<BuildRenderTree>b__17_0(RenderTreeBuilder __builder2)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Microsoft.AspNetCore.Components.CascadingValue`1[[Telerik.Blazor.Components.ListView.IListViewCommandContainer, Telerik.Blazor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=20b4b0547069c4f8]].Render(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

 

1 comment
Vicente
Posted on: 10 Jun 2022 16:02
Sorry, I already found the problem is that the OnModelInit method was returning a null. It's already solved