LottieSharp
LottieSharp copied to clipboard
System.NullReferenceException: Object reference not set to an instance of an object.
Getting this exception while using spinner control. had downloaded the source code and fixed issue locally, how do we put the fix as part of upcoming release. Fix details, Filename: LottieSharp-master\LottieSharp\WpfSurface\D2dControl.cs on line number 135 inside method "OnIsFrontBufferAvailableChanged" added null check as follows if (d3DSurface != null && d3DSurface.IsFrontBufferAvailable)
Exception Details: Unhandled exception System.NullReferenceException: Object reference not set to an instance of an object. at LottieSharp.WpfSurface.D2dControl.OnIsFrontBufferAvailableChanged(Object sender, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyPropertyChangedEventHandler.Invoke(Object sender, DependencyPropertyChangedEventArgs e) at System.Windows.Interop.D3DImage.IsFrontBufferAvailablePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.Freezable.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyPropertyKey key, Object value) at System.Windows.Interop.D3DImage.SetIsFrontBufferAvailable(Object isAvailableVersionPair) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at Sncr.Cloud.UI.App.Main() An unhandled exception of type 'System.NullReferenceException' occurred in WindowsBase.dll Object reference not set to an instance of an object.
@OmidID It will be great if we we come to know about expected release for the issue.
I got same problem
I have the same problem, did you find a solution?
I have the same problem, did you find a solution?
No you can use MediaElement
or this lib https://github.com/XamlAnimatedGif/WpfAnimatedGif
Hey !
Had the same issue.
1 - Put your json in solution
2 - Check settings
3 - Check your .csproj and find the new line
4 - Update your xaml
Thats how i fix mine :)
Hope it will help you too
You're great, it worked for me, thank you.