mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-14 15:21:01 +00:00
catch icon generation errors and log to console (#441)
This commit is contained in:
@@ -174,7 +174,14 @@ function getColors(address: string): string[] {
|
||||
* @description Generate a array of the circles that make up an indenticon
|
||||
*/
|
||||
function generate(address: string, isSixPoint = false): Circle[] {
|
||||
const colors = getColors(address);
|
||||
let colors: string[] = [];
|
||||
try {
|
||||
colors = getColors(address);
|
||||
} catch (e) {
|
||||
console.error(
|
||||
`Error decoding address to generate validator icon for: ${address} (${e})`
|
||||
);
|
||||
}
|
||||
|
||||
return [OUTER_CIRCLE].concat(
|
||||
getCircleXY(isSixPoint).map(
|
||||
@@ -183,7 +190,7 @@ function generate(address: string, isSixPoint = false): Circle[] {
|
||||
cx,
|
||||
cy,
|
||||
r: Z,
|
||||
fill: colors[index],
|
||||
fill: colors[index] || 'rgb(255,255,255)',
|
||||
};
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user