Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PVR] Prevent crash on saved search #23193

Merged
merged 1 commit into from
Apr 23, 2023
Merged

[PVR] Prevent crash on saved search #23193

merged 1 commit into from
Apr 23, 2023

Conversation

emveepee
Copy link
Contributor

Description

When a PVR search is first created it is possible to hit Save which saves to the database and then performs a search. In this scenario the searchFilter parameter is not instantiated before OpenDialogSearch() is called leading to crash when it is referenced.

Check that the searchFilter is not empty before trying to populate it.

Motivation and context

This fixes a hard crash.

How has this been tested?

I could not determine the merit of the code that is causing the crash, but I assume it would handle a future change in the database persistance logic if the row id were to change. In the case of a new search this would not be an in issue.

Also for new searches the passed searchField parameter is also a class variable and the class variable is initialized in SetSearchFilter().

Tested on Windows 11 with current Omega build.

What is the effect on users?

The search is saved but it avoids a crash. It might be possible to remove save as an option on the first call but for users who repeat known searches on clients this would introduce an extra strep.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

New PVR searches do no create an instance of the searchFilter
@emveepee emveepee requested a review from ksooo as a code owner April 23, 2023 15:09
@ksooo ksooo added Type: Fix non-breaking change which fixes an issue Component: PVR Backport: Needed v21 Omega labels Apr 23, 2023
@ksooo ksooo added this to the Omega 21.0 Alpha 2 milestone Apr 23, 2023
Copy link
Member

@ksooo ksooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks. Could you open a backport PR, please?

@ksooo
Copy link
Member

ksooo commented Apr 23, 2023

jenkins build this please

@ksooo ksooo merged commit 5129e33 into xbmc:master Apr 23, 2023
1 check passed
@emveepee emveepee deleted the searchcrash branch June 7, 2023 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport: Done Component: PVR Type: Fix non-breaking change which fixes an issue v21 Omega
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants