File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def get_safari_version
41
41
version = ''
42
42
43
43
f = read_file ( "/Applications/Safari.app/Contents/version.plist" )
44
- xml = REXML ::Document . new ( f )
44
+ xml = REXML ::Document . new ( f ) rescue nil
45
45
return version if xml . root . nil?
46
46
47
47
xml . elements [ 'plist/dict' ] . each_element do |e |
@@ -66,7 +66,7 @@ def peer
66
66
#
67
67
def plutil ( filename )
68
68
cmd_exec ( "plutil -convert xml1 #{ filename } " )
69
- read_file ( filename )
69
+ cmd_exec ( "cat #{ filename } " )
70
70
end
71
71
72
72
@@ -88,7 +88,7 @@ def get_lastsession
88
88
def get_sessions ( lastsession )
89
89
session_dict = nil
90
90
91
- xml = REXML ::Document . new ( lastsession )
91
+ xml = REXML ::Document . new ( lastsession ) rescue nil
92
92
return nil if xml . root . nil?
93
93
94
94
xml . elements [ 'plist' ] . each_element do |e |
You can’t perform that action at this time.
0 commit comments