baltica 2.0.8 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,7 +137,9 @@ class Client extends utils_1.Emitter {
137
137
  }
138
138
  close() {
139
139
  try {
140
- this.raknet.close();
140
+ if (this.raknet && typeof this.raknet.close === "function") {
141
+ this.raknet.close();
142
+ }
141
143
  }
142
144
  catch { }
143
145
  this.removeAllListeners();
@@ -145,7 +147,9 @@ class Client extends utils_1.Emitter {
145
147
  disconnect(reason = "client disconnect") {
146
148
  this.emit("disconnect", reason);
147
149
  setTimeout(() => {
148
- this.raknet.disconnect();
150
+ if (this.raknet && typeof this.raknet.disconnect === "function") {
151
+ this.raknet.disconnect();
152
+ }
149
153
  this.removeAllListeners();
150
154
  }, 50);
151
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baltica",
3
- "version": "2.0.8",
3
+ "version": "2.0.9",
4
4
  "description": "Core baltica package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",