Skip to content

Commit

Permalink
vcs: fixed test with null Context2D
Browse files Browse the repository at this point in the history
  • Loading branch information
sehugg committed Nov 13, 2023
1 parent 44271fe commit 1a7a242
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand Down
4 changes: 3 additions & 1 deletion src/platform/vcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ class VCSPlatform extends BasePlatform {
const {x,y} = this.getRasterCanvasPosition();
if (x >= 0 || y >= 0) {
const ctx = this.canvas.getContext('2d');
drawCrosshair(ctx, x, y, 2);
if (ctx) {
drawCrosshair(ctx, x, y, 2);
}
}
}
};
Expand Down

0 comments on commit 1a7a242

Please sign in to comment.