jimmejardine / qiqqa-open-source

The open-sourced version of the award-winning Qiqqa research management tool for Windows
GNU General Public License v3.0
366 stars 60 forks source link

NullReferenceException following search or highlight #299

Open zhangxiaoxing opened 3 years ago

zhangxiaoxing commented 3 years ago

Not complaining, great jobs everyone. Just FYI.

Qiqqa version: Current version: 83 Current build: 83.0.7656.6401

The exception following search (any word, but only some pdf files) reads:

20210205065313:System.NullReferenceException: Object reference not set to an instance of an object.
   at Qiqqa.Documents.PDF.PDFControls.Page.Search.PDFSearchLayer.SetNextSearchPosition(PDFSearchResult previous_search_result_placeholder)
   at Qiqqa.Documents.PDF.PDFControls.PDFRendererControl.SetSearchKeywords(PDFSearchResultSet search_result_set)
   at Qiqqa.Documents.PDF.PDFControls.PDFReadingControl.SetSearchKeywords_EXECUTE(String search_string)
   at Qiqqa.Documents.PDF.PDFControls.PDFReadingControl.SetSearchKeywords()
   at Qiqqa.Documents.PDF.PDFControls.PDFReadingControl.TextBoxFind_OnHardSearch()
   at Utilities.GUI.AugmentedSearchBox.FireOnHardSearch()
   at Utilities.GUI.AugmentedSearchBox.TextSearch_KeyUp(Object sender, KeyEventArgs e)
   at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   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)

--------------------------------------------

The exception following highlight then refresh (on every pdf, persistent cross multiple sessions) reads:

20210205070627:System.NullReferenceException: Object reference not set to an instance of an object.
   at Qiqqa.Documents.PDF.PDFControls.Page.Highlight.PDFHighlightLayer.PDFHighlightLayer_Loaded(Object sender, RoutedEventArgs e)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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)

--------------------------------------------
zhangxiaoxing commented 3 years ago

Also would like a context menu item in the library UI that clears all annotation associated with a pdf file, in case the pdf cannot be opened due to above reasons.