The law states as far to the right as practicable. Riding into obstacles and the door zone is not practicable.
Also, the law makes the exception to move to the left to avoid obstacles. The door zone, with its potential to have an opening door kill you is an obstacle. So you have 2 different aspects of the law working in YOUR favor.