From 3f920d8904745e12e7771d98ebc9d0d7c5a4a8d5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 10 Feb 2016 12:34:43 -0800 Subject: [PATCH] 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 --- scripts/ssh/ssh-exec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ssh/ssh-exec.php b/scripts/ssh/ssh-exec.php index 45dacddebd..2238bab478 100755 --- a/scripts/ssh/ssh-exec.php +++ b/scripts/ssh/ssh-exec.php @@ -129,7 +129,7 @@ try { throw new Exception( pht( 'Invalid device name ("%s"). There is no device with this name.', - $device->getName())); + $device_name)); } // We're authenticated as a device, but we're going to read the user out of