We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ee4b34 commit e62b648Copy full SHA for e62b648
1 file changed
app/helpers/ExerciseConfig/Pipeline/Box/Boxes/base/ScalarToArrayBox.php
@@ -92,6 +92,12 @@ public function getDefaultOutputPorts(): array {
92
* @throws ExerciseConfigException
93
*/
94
public function compile(CompilationParams $params): array {
95
+ if ($this->getInputPortValue(self::$IN_PORT_KEY)->isEmpty()) {
96
+ // pointless usage of box, but hell, we have to be ready for that
97
+ $this->getOutputPortValue(self::$OUT_PORT_KEY)->setValue(null);
98
+ return [];
99
+ }
100
+
101
// will not produce tasks, only convert scalar value into single-item array
102
$in = $this->getInputPortValue(self::$IN_PORT_KEY)->getValue();
103
$this->getOutputPortValue(self::$OUT_PORT_KEY)->setValue([ $in ]);
0 commit comments