Skip to content

Commit ab186ae

Browse files
committed
throw error if no drawing
1 parent 8883240 commit ab186ae

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

signaturepad.android.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ var SignaturePad = (function (_super) {
3434
};
3535
Object.defineProperty(SignaturePad.prototype, "drawing", {
3636
get: function () {
37-
// check if empty first
38-
if (!this._android.isEmpty())
39-
console.log('has drawing');
40-
return this._android.getTransparentSignatureBitmap();
37+
if (!this._android.isEmpty()) {
38+
return this._android.getTransparentSignatureBitmap();
39+
}
40+
else {
41+
throw new Error("No drawing in the pad.");
42+
}
4143
},
4244
enumerable: true,
4345
configurable: true

signaturepad.android.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ export class SignaturePad extends common.SignaturePad {
2727
}
2828

2929
get drawing(): any {
30-
// check if empty first
31-
if (!this._android.isEmpty())
32-
console.log('has drawing');
30+
if (!this._android.isEmpty()) {
3331
return this._android.getTransparentSignatureBitmap();
32+
} else {
33+
throw new Error("No drawing in the pad.");
34+
}
3435
}
3536

3637
}

0 commit comments

Comments
 (0)