Fix that with multiple canvases there is a comparison with a nullptr, ref #167