Error message when opening the context menu of a capacity chart

When opening the context menu using the right mouse button of a capacity chart, an error message could occur, and the menu might not open at all.