Skip to content

Commit 3f920d8

Browse files
author
epriestley
committed
Fix method call on possible null
Summary: Fixes T10317. If we failed to load `$device`, it will be null, so we won't be able to call `getName()` on it. Test Plan: `SSH_CLIENT='127.0.0.1' ./bin/ssh-exec --phabricator-ssh-device xyz` no longer fatals Reviewers: chad Reviewed By: chad Maniphest Tasks: T10317 Differential Revision: https://secure.phabricator.com/D15235
1 parent 7bca452 commit 3f920d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/ssh/ssh-exec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
throw new Exception(
130130
pht(
131131
'Invalid device name ("%s"). There is no device with this name.',
132-
$device->getName()));
132+
$device_name));
133133
}
134134

135135
// We're authenticated as a device, but we're going to read the user out of

0 commit comments

Comments
 (0)