Skip to content

Commit

Permalink
1.36.3 guard clause for init (missing sdkType)
Browse files Browse the repository at this point in the history
1.36.3 guard clause for init (missing sdkType)

Seen in sentry.io reports initialization of instance w/o sdkType defined.
  • Loading branch information
MikalDev committed Feb 11, 2021
1 parent a9ff506 commit 53321bf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
Binary file added dist/Spine-v1.36.3.c3addon
Binary file not shown.
2 changes: 1 addition & 1 deletion src/addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "plugin",
"name": "Spine",
"id": "Gritsenko_Spine",
"version": "1.36.2",
"version": "1.36.3",
"author": "Mikal and Igor Gritsenko",
"website": "https://gritsenko.github.io/c3_spine_plugin",
"documentation": "https://gritsenko.github.io/c3_spine_plugin",
Expand Down
11 changes: 11 additions & 0 deletions src/c3runtime/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,17 @@
}

IsSpineReady() {
// Guard for case where sdkType does not exist (deleted on release)
if (this.sdkType === null || this.sdkType === undefined)
{
if (this.debug) console.warn('[Spine] IsSpineReady, sdkType not defined', this.sdkType);
if (globalThis.Sentry)
{
globalThis.Sentry.captureException('[Spine] IsSpineReady, sdkType not defined:'+this.sdkType);
}
return false;
}

if (this.isSkeletonLoaded) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/c3runtime/spine-draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,6 @@ class SpineBatch {

if (!globalThis.spineBatcher)
{
console.log('[Spine] SpineBatcher init, 1.36.2');
console.log('[Spine] SpineBatcher init, 1.36.3');
globalThis.spineBatcher = new SpineBatch();
}
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const C3 = self.C3;

const PLUGIN_ID = "Gritsenko_Spine";
const PLUGIN_VERSION = "1.36.2";
const PLUGIN_VERSION = "1.36.3";
const PLUGIN_CATEGORY = "general";

const PLUGIN_CLASS = SDK.Plugins.Gritsenko_Spine = class SpinePlugin extends SDK.IPluginBase {
Expand Down

0 comments on commit 53321bf

Please sign in to comment.