File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ def started_command
385385 def run_action_user
386386 return user if user . present?
387387
388- docker? ? docker_run_action_user : AppModel ::DEFAULT_CONTAINER_USER
388+ app &. docker? ? docker_run_action_user : AppModel ::DEFAULT_CONTAINER_USER
389389 end
390390
391391 def specified_or_detected_command
Original file line number Diff line number Diff line change @@ -747,6 +747,17 @@ def act_as_cf_admin
747747 end
748748 end
749749 end
750+
751+ context 'when the associated app is nil' do
752+ before do
753+ process . app = nil
754+ end
755+
756+ it 'does not raise an error and returns nil' do
757+ expect { process . run_action_user } . not_to raise_error
758+ expect ( process . run_action_user ) . to eq ( 'vcap' )
759+ end
760+ end
750761 end
751762
752763 describe '#specified_or_detected_command' do
You can’t perform that action at this time.
0 commit comments