If you have 4 and more Danger Cubes on a Location in the last phase of your turn (after playing Directive Cards ) you have to immediately allocate all Danger Cubes in excess of 3 to any Character of your choice.
If also a Character is present on this location, you would first allocate any Danger Cubes in excess of 3 to any of the 3 Characters and the would allocate the remaining 3 Danger Cubes to the Character on this location.
E.g. The Senator is unfortunately at the Community Center where, after resolving the latest Event, 5 Danger Cubes are allocated. Roberto can help in the "Play Directive Cards" phase by playing a Directive Cards which lets him remove 1 Danger Cube from the Community Center. So there are still Danger Cubes left to be allocated in the "Picking up Danger and Inspiration" phase. 1 Danger cube has to be added to any Character; the players decide to give this Danger Cube to the Scientist as she has non so far. The remaining 3 Danger Cubes are added to the Senator.