Check REQUEST_CONTEXT.context exists before accessing it.

LMS-11226
or write one for CMS, one for LMS