Skip to content

Commit 4b48060

Browse files
committed
bump, try/catch background color
1 parent b5fd5b8 commit 4b48060

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/fab.android.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,16 @@ export class Fab extends FloatingActionButtonBase {
5353
}
5454

5555
[backColorProperty.setNative](value: Color) {
56-
this.nativeView.setBackgroundTintList(
57-
android.content.res.ColorStateList.valueOf(value.android)
58-
);
56+
if (value) {
57+
try {
58+
this.nativeView.setBackgroundTintList(
59+
android.content.res.ColorStateList.valueOf(value.android)
60+
);
61+
} catch (error) {
62+
// do nothing, catch bad color value
63+
console.log("bad background-color value: ", error);
64+
}
65+
}
5966
}
6067

6168
[backgroundColorProperty.getDefault](): android.content.res.ColorStateList {

src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-floatingactionbutton",
3-
"version": "4.0.2",
3+
"version": "4.0.3",
44
"description": "A NativeScript plugin for Material Design Floating Action Button.",
55
"main": "fab",
66
"typings": "index.d.ts",

0 commit comments

Comments
 (0)