Skip to content

Commit c7719bf

Browse files
committed
Verify response is non-nil.
1 parent 9e1f106 commit c7719bf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/auxiliary/admin/http/rails_devise_pass_reset.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ def generate_token(account)
6868
'data' => postdata,
6969
})
7070

71+
unless (res)
72+
print_error("No response from server")
73+
return false
74+
end
75+
7176
if res.code == 200
7277
error_text = res.body[/<div id=\"error_explanation\">\n\s+(.*?)<\/div>/m, 1]
7378
print_error("Server returned an error:")
@@ -107,6 +112,10 @@ def reset_one(password, report=false)
107112
'ctype' => 'application/xml',
108113
'data' => xml,
109114
})
115+
unless (res)
116+
print_error("No response from server")
117+
return false
118+
end
110119

111120
case res.code
112121
when 200

0 commit comments

Comments
 (0)