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: nil pointer check for instance #172

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

pratikmota
Copy link
Contributor

Problem:

  • foundImage is Pointer of civogo.Instance
  • In case if GetOk() is not satisfied then both conditions will fail. foundImage pointer will remain nil
  • If the pointer is nil then it will give a memory access violation for using foundImage.XXX properties.

Solution:

  • If we are using pointer then need to check for nil value
  • If nil value found then return error

My Changes:

  • Checking foundImage pointer value is nil or not
  • if nil is found then return an error for dataSourceInstanceRead function
  • Spelling mistake correction: retrive --> retrieve

@alejandrojnm alejandrojnm merged commit 6928716 into civo:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants