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: properly check for null buffer loaded state on review open #848

Conversation

GuillaumeLagrange
Copy link
Collaborator

Describe what this PR does / why we need it

Fixes a lua error that happened this way

  1. Open review
  2. Close review
  3. Delete null buffer (for example using <cmd>%bd!|e#|bd!#<cr>)
  4. Open review
  5. See this error
 Error executing vim.schedule lua callback: ...neovim-plugins/octo.nvim/lua/octo/reviews/file-entry.lua:492: Invalid buffer id: 6
 stack traceback:
         [C]: in function 'nvim_win_set_buf'
         ...neovim-plugins/octo.nvim/lua/octo/reviews/file-entry.lua:492: in function 'load_null_buffer'
         ...neovim-plugins/octo.nvim/lua/octo/reviews/file-entry.lua:485: in function 'load_null_buffers'
         ...ume/neovim-plugins/octo.nvim/lua/octo/reviews/layout.lua:247: in function 'file_safeguard'
         ...ume/neovim-plugins/octo.nvim/lua/octo/reviews/layout.lua:57: in function 'open'
         ...laume/neovim-plugins/octo.nvim/lua/octo/reviews/init.lua:190: in function 'initiate'
         ...laume/neovim-plugins/octo.nvim/lua/octo/reviews/init.lua:123: in function 'callback'
         ...laume/neovim-plugins/octo.nvim/lua/octo/reviews/init.lua:75: in function 'cb'
         .../guillaume/neovim-plugins/octo.nvim/lua/octo/gh/init.lua:164: in function ''
         vim/_editor.lua: in function <vim/_editor.lua:0>

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

Checklist

  • Passing tests and linting standards
  • Documentation updates in README.md and doc/octo.txt

@GuillaumeLagrange GuillaumeLagrange changed the title fix: properly check for null buffer loading state on review open fix: properly check for null buffer loaded state on review open Feb 5, 2025
@GuillaumeLagrange GuillaumeLagrange force-pushed the error-when-opening-review-while-review-already-open branch from 28d1ff2 to 81a0a72 Compare February 5, 2025 13:13
@GuillaumeLagrange GuillaumeLagrange merged commit 81a0a72 into pwntester:master Feb 5, 2025
3 checks passed
@GuillaumeLagrange GuillaumeLagrange deleted the error-when-opening-review-while-review-already-open branch February 5, 2025 13:38
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.

1 participant