Skip to content

Commit

Permalink
fix: 🐛 when animating code can throw an error "wrong syntax"
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaiklor committed Jun 13, 2020
1 parent e7ad7b6 commit dbd1734
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/shapes/kittik-shape-code/src/Code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export class Code extends Shape implements CodeOptions, ShapeRenderable {
public render <T extends Canvas>(canvas: T): void {
super.render(canvas);

const codeSplits = redeyed(this.text, DEFAULT_THEME).splits;
let codeSplits: string[] = [];
try {
codeSplits = redeyed(this.text, DEFAULT_THEME).splits;
} catch (error) {
codeSplits = [this.text];
}

const x = parseInt(this.x, 10);
const y = parseInt(this.y, 10);

Expand Down

0 comments on commit dbd1734

Please sign in to comment.