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 Rollbar 16883 Error: Attempt to assign property "assigned_to" on null #12470

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Feb 7, 2023

Description

In the License Importer, we try to get a free license seat to assign as required, but if we don't have any the system fails with Attempt to assign property "assigned_to" on null error. This PR takes care of that adding a guard clause to return early if no empty seat is found, ignoring that assignation.

We can make the system to fail if no empty license seat is found, but looking at the code I understood that the Importer ignores the assignation if no seat is found and I thought this makes the Importer consistent in both error cases (no seats left or no empty seat found). Let me know if you think it's better to return the error instead.

Fixes Rollbar 16883

Type of change

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

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.2
  • MySQL version: 8.0.31
  • Webserver version: PHP dev server
  • OS version: Debian 11

@what-the-diff
Copy link

what-the-diff bot commented Feb 7, 2023

  • Added a check to see if the license is null
  • If it's not, then we assign the user and asset id to that license

@snipe snipe merged commit bfac0fc into snipe:develop Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants