SofaDefrost / STLIB

Sofa Template Library
GNU Lesser General Public License v3.0
17 stars 22 forks source link

Check if key exists in dictionary before access #99

Closed alxbilger closed 1 year ago

alxbilger commented 1 year ago

The following triggers a KeyError exception because the key MazeScene is not in sys.modules: https://github.com/SofaDefrost/SofaGym/blob/70f2a5b34f012f2ba071eddc0cec7e71d30841e2/sofagym/envs/Maze/MazeScene.py

This PR checks if the key is in the dictionary first.

damienmarchal commented 1 year ago

ok to me.