Skip to content

Commit

Permalink
Fix empty values when checking url?.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Jan 27, 2017
1 parent 5796d56 commit 350606b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/registration/widgets/registration_code.rb
Expand Up @@ -61,20 +61,19 @@ def store
def register
if skip?
log.info("Empty value, skipping registration")
return true
return false
end

if Registration.is_registered?
log.info("The system is already registered so skipped registration.")
return true
return false
end

if !SwMgmt.find_base_product
Helpers.report_no_base_product
return false
end


log.info("Registering the system and the base product.")
# Error reports and logs about the registration are mostly handled
# by ConnectHelpers.catch_registration_errors and used by instances
Expand Down Expand Up @@ -106,6 +105,8 @@ def error(message)
end

def url?
return false if value.to_s.empty?

uri = URI(value)
uri.scheme ? true : false
rescue URI::InvalidURIError
Expand Down

0 comments on commit 350606b

Please sign in to comment.