Skip to content

Commit

Permalink
bump, try/catch background color
Browse files Browse the repository at this point in the history
  • Loading branch information
bradmartin committed Oct 2, 2017
1 parent b5fd5b8 commit 4b48060
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/fab.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 53,16 @@ export class Fab extends FloatingActionButtonBase {
}

[backColorProperty.setNative](value: Color) {
this.nativeView.setBackgroundTintList(
android.content.res.ColorStateList.valueOf(value.android)
);
if (value) {
try {
this.nativeView.setBackgroundTintList(
android.content.res.ColorStateList.valueOf(value.android)
);
} catch (error) {
// do nothing, catch bad color value
console.log("bad background-color value: ", error);
}
}
}

[backgroundColorProperty.getDefault](): android.content.res.ColorStateList {
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
{
"name": "nativescript-floatingactionbutton",
"version": "4.0.2",
"version": "4.0.3",
"description": "A NativeScript plugin for Material Design Floating Action Button.",
"main": "fab",
"typings": "index.d.ts",
Expand Down

0 comments on commit 4b48060

Please sign in to comment.