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

Fixed Call to a member function checkedOutToUser() on null [rollbar-3598] #13586

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Sep 11, 2023

Description

In #13574 I added a call to the Asset::checkedOutToUser() function to decide if show an asset in the Unaccepted Asset report. But I turned out to introduce a bug when the asset is deleted before the user accept it.

I added a boolean to be set by the function if the asset still exists, and if not I passed it as false, so that register also get filetered in the report.

Fixes rollbar 3598

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1
  • MySQL version: 8.0.31
  • Webserver version: PHP Dev Server
  • OS version: Debian 12

@what-the-diff
Copy link

what-the-diff bot commented Sep 11, 2023

PR Summary

  • Inclusion of an Additional Condition in ReportsController.php
    A safeguard check has been added in the reports controller. The modification ensures that the system checks if the property 'checkoutable' is in place before it tries to execute the 'checkedOutToUser()' method. This helps in preventing any undesired system errors or crashes that could potentially occur if the property isn't available when the method is called.

@snipe snipe merged commit f6a11ac into snipe:develop Sep 12, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants