From 08b54224cae2a4f03c0a68883a758bbfd9e0aa0a Mon Sep 17 00:00:00 2001 From: Claudio Dekker <1752195+claudiodekker@users.noreply.github.com> Date: Wed, 16 Jun 2021 17:48:57 +0200 Subject: [PATCH] Bugfix: Prevent 'emptystring' files --- src/BlockManager.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BlockManager.php b/src/BlockManager.php index f4ce122..ace3fc1 100644 --- a/src/BlockManager.php +++ b/src/BlockManager.php @@ -116,8 +116,11 @@ protected function filesWithBlocks() { // Recursively look for any blocks in the output // directory, returning only the paths. - return explode( + $output = explode( "\n", trim(shell_exec("grep -l -r __torchlight-block- {$this->jigsaw->getDestinationPath()}/*")) ); + + // Filter out empty values caused by our grep query. + return array_filter($output); } }