diff --git a/src/applications/files/conduit/FileQueryChunksConduitAPIMethod.php b/src/applications/files/conduit/FileQueryChunksConduitAPIMethod.php index e0929ef8c4..847c91e3df 100644 --- a/src/applications/files/conduit/FileQueryChunksConduitAPIMethod.php +++ b/src/applications/files/conduit/FileQueryChunksConduitAPIMethod.php @@ -21,10 +21,19 @@ final class FileQueryChunksConduitAPIMethod return 'list'; } + protected function defineErrorTypes() { + return array( + 'ERR-BAD-PHID' => pht('Must pass a PHID.'), + ); + } + protected function execute(ConduitAPIRequest $request) { $viewer = $request->getUser(); $file_phid = $request->getValue('filePHID'); + if (!$file_phid) { + throw new ConduitException('ERR-BAD-PHID'); + } $file = $this->loadFileByPHID($viewer, $file_phid); $chunks = $this->loadFileChunks($viewer, $file); diff --git a/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php b/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php index eab46c4992..0dcce998ca 100644 --- a/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php +++ b/src/applications/files/conduit/FileUploadChunkConduitAPIMethod.php @@ -24,10 +24,19 @@ final class FileUploadChunkConduitAPIMethod return 'void'; } + protected function defineErrorTypes() { + return array( + 'ERR-BAD-PHID' => pht('Must pass a PHID.'), + ); + } + protected function execute(ConduitAPIRequest $request) { $viewer = $request->getUser(); $file_phid = $request->getValue('filePHID'); + if (!$file_phid) { + throw new ConduitException('ERR-BAD-PHID'); + } $file = $this->loadFileByPHID($viewer, $file_phid); $start = $request->getValue('byteStart');