Ruben2776 / PicView

Fast, free and customizable image viewer for Windows 10 and 11.
https://picview.org
Other
995 stars 66 forks source link

PicView.EditTitleBar crashes app when no image is loaded. #14

Closed Yevrag35 closed 4 years ago

Yevrag35 commented 4 years ago

Describe the bug Launched the app and went to move the window by grabbing the title bar. Inadvertently, I clicked the "No image loaded" message and that caused the app to crash. The issue looks to be caused by PicView.EditTitleBar.EditTitleBar_Text:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at PicView.EditTitleBar.EditTitleBar_Text(Object sender, KeyboardFocusChangedEventArgs e)
   at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

To Reproduce Steps to reproduce the behavior:

  1. Download the win-x64.7z file.
  2. Launch the app from the .exe
  3. Click the "No Image Loaded" area of the title bar when no image is loaded.

Expected behavior If no image is loaded, no edit title bar behavior should be observed.

Nice app though :)

EDIT -- Should note that building the app from the source code does not produce this behavior.

Ruben2776 commented 4 years ago

Thanks a lot for trying my app out! :)

I'll make a new release soon with it fixed.

Ruben2776 commented 4 years ago

Fixed in release 0.9.9 https://github.com/Ruben2776/PicView/releases/tag/0.9.9