Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG] attempt to index nil value

未关闭 适合新手
#557 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
flutter, lua, neovim

调研方向

该故障在 lua/flutter-tools/commands.lua:59 的 update_device_from_output 中报告,由 on_run_data 和 job_runner.lua:55 调用。请在所述环境中先执行 FlutterRun,再执行 FlutterQuit 以重现,检查缺少输出时的处理方式,并确认命令退出时不会出现 callback 错误。

由索引模型根据 Issue 内容生成。

描述

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

An error pops up when running FlutterQuit during a running session. The error is pasted below (and a screenshot after):

Error executing vim.schedule lua callback: ...m/lazy/flutter-tools.nvim/lua/flutter-tools/commands.lua:59: attempt to index local 'line' (a nil value)                                              
stack traceback:                                                                                                                                                                                    
        ...m/lazy/flutter-tools.nvim/lua/flutter-tools/commands.lua:59: in function 'update_device_from_output'                                                                                     
        ...m/lazy/flutter-tools.nvim/lua/flutter-tools/commands.lua:119: in function 'on_run_data'                                                                                                  
        ...tter-tools.nvim/lua/flutter-tools/runners/job_runner.lua:55: in function ''                                                                                                              
        vim/_editor.lua: in function <vim/_editor.lua:0>
Image
Expected Behavior

There shouldn't be any errors.

Steps To Reproduce
  1. Run a project on a device via FlutterRun
  2. Run FlutterQuit to quit
  3. Observe the error
Environment
- OS: macOS 27.0
- Flutter version: 3.48.0-0.5.pre
- Is flutter in $PATH: Yes
- neovim version: 0.11.4
Anything else?

Seems a pretty simple fix: a nil check on line at lua/flutter-tools/commands.lua:59.

主要语言
Lua
星标
1.4k
派生
116
平均合并
3 小时 16 分钟
30 天内合并 PR
20

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nvim-flutter/flutter-tools.nvim 的其他 Issue

查看 nvim-flutter/flutter-tools.nvim 的全部 Issue

相似的 Issue

更多 Lua Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。