Skip to content

[Bug] minimax-pdf make.sh check 在Windows上检测失败 & minimax-docx 24个空引用警告 #93

@supertonnylee-spec

Description

@supertonnylee-spec

发现的问题

1. minimax-pdf: make.sh check 在Windows上检测失败

问题描述:

  • Windows上 python3 命令是Windows App Store的stub,执行后返回退出码49,无法正常工作
  • Playwright作为npm包嵌套在 @playwright/mcp 依赖下,直接 require('playwright') 检测失败
  • 但实际依赖都已安装且可用(python 命令可用,python -c "import reportlab" 成功)

错误输出:

Checking dependencies...
  ✓ python3 (显示但实际异常)
  ⚠ reportlab not installed
  ⚠ pypdf not installed
  ⚠ playwright not found
  ⚠ matplotlib not installed

修复方案:
修改 skills/minimax-pdf/scripts/make.sh:

  1. 优先检测 python 命令而非 python3(Windows兼容)
  2. 添加多层Playwright检测:直接require → 全局npm嵌套依赖 → Python playwright
  3. 使用 $PY 变量统一Python命令调用

2. minimax-docx: 24个空引用警告 (CS8602)

问题描述:
C#代码中存在多处潜在的空引用解引用,编译产生24个警告:

warning CS8602: 解引用可能出现空引用

涉及文件:

  • Commands/EditContentCommand.cs - 多处 doc.MainDocumentPart?.Document.Body 后直接使用
  • Commands/ApplyTemplateCommand.cs - outputMain.Document.Save()
  • Samples/ListAndNumberingSamples.cs - numPart.Numbering.Append()EnsureNumberingRoot
  • Samples/ImageSamples.cs - headerPart.Header 可能为null
  • Samples/DocumentCreationSamples.cs - mainPart.Document.Body 检查不完整
  • OpenXml/CommentSynchronizer.cs - mainPart.Document.Body

修复方案:

  1. 提取 mainPart 变量,添加null检查后使用 ! 操作符
  2. EnsureNumberingRoot 确保初始化后使用 ! 操作符
  3. 为可能为null的对象添加创建逻辑(如 Header

验证结果

修复后:

  • minimax-pdf: All dependencies satisfied
  • minimax-docx: 0 个警告,0 个错误

环境

  • OS: Windows 11 Pro 10.0.26200
  • Python: 3.13.12 (conda-forge)
  • Node: v24.15.0
  • .NET SDK: 10.0.203

如果需要,我可以提供完整的修复patch或PR。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions