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

fix: validation in cask_and_kegs #2425

Closed
wants to merge 3 commits into from
Closed

Conversation

odisk777
Copy link
Contributor

@odisk777 odisk777 commented Mar 12, 2024

The error you've shown seems to be related to the getItem() method you're trying to call on the target object. However, in your code, you're checking if target or target:getItem() is nil before calling this method. This means that the error shouldn't occur at this point.

Since the error mentioned line 29 of your cask_and_kegs.lua file, I suggest you review that specific line to ensure you're not trying to call getItem() incorrectly or from an incorrect object.

If line 29 is where getItem() is called, there might be an issue with how the target object is being obtained or passed. Make sure target is a valid object that has the getItem() method defined. Additionally, verify that target is not nil before attempting to call its getItem() method.

[error] Lua Script Error Detected

Interface: Scripts Interface
Script ID: /data/scripts/actions/objects/cask_and_kegs.lua:callback Error Description: .../data/scripts/actions/objects/cask_and_kegs.lua:29: attempt to call method 'getItem' (a nil value) stack traceback:
[C]: in function 'getItem'
.../data/scripts/actions/objects/cask_and_kegs.lua:29: in function <.../data/scripts/actions/objects/cask_and_kegs.lua:28>

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Behaviour

Actual

Do this and that doesn't happens

Expected

Do this and that happens

Fixes #issuenumber

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Server Version:
  • Client:
  • Operating System:

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I checked the PR checks reports
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

The error you've shown seems to be related to the getItem() method you're trying to call on the target object. However, in your code, you're checking if target or target:getItem() is nil before calling this method. This means that the error shouldn't occur at this point.

Since the error mentioned line 29 of your cask_and_kegs.lua file, I suggest you review that specific line to ensure you're not trying to call getItem() incorrectly or from an incorrect object.

If line 29 is where getItem() is called, there might be an issue with how the target object is being obtained or passed. Make sure target is a valid object that has the getItem() method defined. Additionally, verify that target is not nil before attempting to call its getItem() method.

[error] Lua Script Error Detected
---------------------------------------
Interface: Scripts Interface
Script ID: /data/scripts/actions/objects/cask_and_kegs.lua:callback
Error Description: .../data/scripts/actions/objects/cask_and_kegs.lua:29: attempt to call method 'getItem' (a nil value)
stack traceback:
        [C]: in function 'getItem'
        .../data/scripts/actions/objects/cask_and_kegs.lua:29: in function <.../data/scripts/actions/objects/cask_and_kegs.lua:28>
@elsongabriel elsongabriel changed the title Update cask_and_kegs.lua fix: validation in cask_and_kegs Mar 18, 2024
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label Apr 18, 2024
@odisk777 odisk777 closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale No activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants