Skip to content

Commit fb73209

Browse files
committed
Fixed crash when livesplit is closed
1 parent e04b318 commit fb73209

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ccmod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "timer",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"title": "CCTimer",
55
"description": "A speedrun timer for CrossCode.",
66
"icons": {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "esbuild --target=es2018 --format=esm --platform=node --bundle --sourcemap=inline --outfile=plugin.js src/plugin.js",
88
"watch": "esbuild --target=es2018 --format=esm --platform=node --bundle --sourcemap=inline --watch --outfile=plugin.js src/plugin.js"
99
},
10-
"version": "3.0.0",
10+
"version": "3.0.1",
1111
"ccmodDependencies": {
1212
"ccloader": "^2.19.0",
1313
"Simplify": "^2.9.0"

src/connectionManager.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class ConnectionManager {
1717
}
1818

1919
sendStart() {
20-
if (!this.livesplit) {
20+
if (!this.livesplit || !this.livesplit.writable) {
2121
return;
2222
}
2323

@@ -30,7 +30,7 @@ export class ConnectionManager {
3030
* @param {number} value
3131
*/
3232
sendIgt(value) {
33-
if (!this.livesplit) {
33+
if (!this.livesplit || !this.livesplit.writable) {
3434
return;
3535
}
3636

@@ -40,7 +40,7 @@ export class ConnectionManager {
4040
}
4141

4242
sendSplit() {
43-
if (!this.livesplit) {
43+
if (!this.livesplit || !this.livesplit.writable) {
4444
console.warn('[timer] Could not send split');
4545
return;
4646
}
@@ -54,7 +54,7 @@ export class ConnectionManager {
5454
* @param {boolean} paused
5555
*/
5656
sendPaused(paused) {
57-
if (!this.livesplit) {
57+
if (!this.livesplit || !this.livesplit.writable) {
5858
return;
5959
}
6060

0 commit comments

Comments
 (0)