From afd4f5f3484ee858b91d9d77d42a748cab3404a6 Mon Sep 17 00:00:00 2001 From: VPusher Date: Fri, 20 Dec 2013 23:24:41 +0100 Subject: [PATCH] Return of "defaults read" is not properly tested Reading plist file with "defaults read" command returns an empty array if the key is not found. The test on the returned value was wrong. --- workflows.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflows.php b/workflows.php index 936b309..4996b67 100644 --- a/workflows.php +++ b/workflows.php @@ -315,7 +315,7 @@ public function get( $a, $b ) { exec( 'defaults read "'. $b .'" '.$a, $out ); // Execute system call to read plist value - if ( $out == "" ): + if ( empty( $out ) ): return false; endif; @@ -480,4 +480,4 @@ public function result( $uid, $arg, $title, $sub, $icon, $valid='yes', $auto=nul return $temp; } -} \ No newline at end of file +}