Add check on null context and log it