context: fix access to component code in live mode

There is no project in live mode, the rest of the function had the right assumptions.