Skip to content
This repository was archived by the owner on Dec 9, 2020. It is now read-only.

Commit 0bfb7d2

Browse files
author
Giulio
committed
Remove incorrect try-catch implementation
1 parent aadb055 commit 0bfb7d2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

classes/EssentialScript/Frontend/Queuing.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ class Queuing {
3939
*/
4040
public function __construct( $handle, $accessories ) {
4141

42-
try {
43-
$func = "\\EssentialScript\\Frontend\Scripts\\" .
44-
str_replace( '-', '', ucwords( $handle, '-' ) );
45-
// Select the concrete component using variable function syntax.
46-
$this->script = new $func();
47-
} catch ( Exception $exc ) {
48-
echo $exc->getTraceAsString();
42+
if ( !is_string( $handle ) ) {
4943
return;
5044
}
5145

46+
$func = "\\EssentialScript\\Frontend\Scripts\\" .
47+
str_replace( '-', '', ucwords( $handle, '-' ) );
48+
// Select the concrete component using variable function syntax.
49+
$this->script = new $func();
50+
5251
// Remove all accessories which are equal to null, 0, '' or false.
5352
$test_accessories = array_filter( $accessories );
5453

0 commit comments

Comments
 (0)