superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kri...@apache.org
Subject [incubator-superset] branch master updated: Add check for invalid color scheme (#6828)
Date Fri, 08 Feb 2019 18:48:05 GMT
This is an automated email from the ASF dual-hosted git repository.

kristw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c090df  Add check for invalid color scheme (#6828)
1c090df is described below

commit 1c090df4a5d6168d0534613ab592ae5c16329f02
Author: Krist Wongsuphasawat <krist.wongz@gmail.com>
AuthorDate: Fri Feb 8 10:47:57 2019 -0800

    Add check for invalid color scheme (#6828)
    
    * add check for invalid scheme
    
    * revert package-lock.json
    
    * revert again
---
 .../assets/src/explore/components/controls/ColorSchemeControl.jsx  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/superset/assets/src/explore/components/controls/ColorSchemeControl.jsx b/superset/assets/src/explore/components/controls/ColorSchemeControl.jsx
index fb18ab1..1e1e677 100644
--- a/superset/assets/src/explore/components/controls/ColorSchemeControl.jsx
+++ b/superset/assets/src/explore/components/controls/ColorSchemeControl.jsx
@@ -71,9 +71,10 @@ export default class ColorSchemeControl extends React.PureComponent {
     // For categorical scheme, display all the colors
     // For sequential scheme, show 10 or interpolate to 10.
     // Sequential schemes usually have at most 10 colors.
-    const colors = isLinear
-      ? currentScheme.getColors(10)
-      : currentScheme.colors;
+    let colors = [];
+    if (currentScheme) {
+      colors = isLinear ? currentScheme.getColors(10) : currentScheme.colors;
+    }
 
     return (
       <ul className="color-scheme-container">


Mime
View raw message