From 0e0957c79b3ecd219eca1cf29a48b2648394b174 Mon Sep 17 00:00:00 2001
From: Alexander Olofsson <alexander.olofsson@liu.se>
Date: Fri, 1 Jun 2018 11:16:58 +0200
Subject: [PATCH] Ignore WQL errors

---
 app/models/wds_server.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/models/wds_server.rb b/app/models/wds_server.rb
index cc96cec..5abf793 100644
--- a/app/models/wds_server.rb
+++ b/app/models/wds_server.rb
@@ -44,7 +44,7 @@ class WdsServer < ApplicationRecord
   end
 
   def clients
-    objects = connection.run_wql('SELECT * FROM MSFT_WdsClient')[:msft_wdsclient]
+    objects = connection.run_wql('SELECT * FROM MSFT_WdsClient')[:msft_wdsclient] rescue nil
     objects = nil if objects.empty?
     objects ||= begin
       data = connection.shell(:powershell) do |s|
-- 
GitLab