Graylog2 / Graylog2/graylog2-server

Do not throw an error when calling `contrastingColor` without a color.

Open
#9,039 0 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
8.1k
Forks
1.1k
Avg merge
1d 20h
Merged PRs (30d)
217

Description

I added a not supported `bsStyle` for an `Alert`. This results in a call of `contrastingColor` with `undefined` for the `color` parameter, which results in the error page the stack trace:

```
Error: unknown format:
at new Color (webpack://__%5Bname%5D/./node_modules/chroma-js/chroma.js?:179:19)
at chroma (webpack://__%5Bname%5D/./node_modules/chroma-js/chroma.js?:197:13)
at Object.contrastingColor (http://localhost:8080/app.js:92459:66)
```

We should e.g. just throw a warning in this case. It is better to see the page with an element that does not has the correct color than seeing the error page.

* Graylog Version: 3.3.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.