File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ 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 )
45
- return version if xml . root . nil?
44
+ xml = REXML ::Document . new ( f ) rescue nil
45
+ return version if xml . nil?
46
46
47
47
xml . elements [ 'plist/dict' ] . each_element do |e |
48
48
if e . text == 'CFBundleShortVersionString'
@@ -76,7 +76,7 @@ def plutil(filename)
76
76
#
77
77
def get_lastsession
78
78
print_status ( "#{ peer } - Looking for LastSession.plist" )
79
- plutil ( "~ /Library/Safari/LastSession.plist" )
79
+ plutil ( "#{ expand_path ( "~" ) } /Library/Safari/LastSession.plist" )
80
80
end
81
81
82
82
@@ -88,8 +88,8 @@ def get_lastsession
88
88
def get_sessions ( lastsession )
89
89
session_dict = nil
90
90
91
- xml = REXML ::Document . new ( lastsession )
92
- return nil if xml . root . nil?
91
+ xml = REXML ::Document . new ( lastsession ) rescue nil
92
+ return nil if xml . nil?
93
93
94
94
xml . elements [ 'plist' ] . each_element do |e |
95
95
found = false
You can’t perform that action at this time.
0 commit comments