mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 10:37:07 +00:00
Protect against out of bounds array condition
This commit is contained in:
@@ -124,8 +124,12 @@ class SequenceDataLayer extends CompositeLayer {
|
|||||||
};
|
};
|
||||||
SequenceDataLayer.layerName = "SequenceDataLayer";
|
SequenceDataLayer.layerName = "SequenceDataLayer";
|
||||||
SequenceDataLayer.tooltip = ({index, sourceLayer}) => {
|
SequenceDataLayer.tooltip = ({index, sourceLayer}) => {
|
||||||
|
try {
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
const p = sourceLayer?.props?.data;
|
const p = sourceLayer?.props?.data;
|
||||||
|
if (index >= p.length) {
|
||||||
|
console.log("Index out of bounds");
|
||||||
|
}
|
||||||
// console.log("P", p);
|
// console.log("P", p);
|
||||||
if (p.type == MSGTYPE.PREPLOT_RAWERROR_OPT) {
|
if (p.type == MSGTYPE.PREPLOT_RAWERROR_OPT) {
|
||||||
|
|
||||||
@@ -149,6 +153,10 @@ SequenceDataLayer.tooltip = ({index, sourceLayer}) => {
|
|||||||
return {html};
|
return {html};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err.message);
|
||||||
|
console.log(index, sourceLayer);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user