Permalink
Browse files

Allow createRegistration args to have zero values

  • Loading branch information...
1 parent 1d939b7 commit 212f3da4ae38c34c75b8bf99e1798791aaabacce @larryl committed Feb 23, 2011
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/WebService/ScormCloud/Service/Registration.pm
@@ -88,11 +88,12 @@ sub createRegistration ## no critic (NamingConventions::Capitalization, Subrouti
$learner_id, $opts)
= @_;
- croak 'Missing course_id' unless $course_id;
- croak 'Missing registration_id' unless $registration_id;
- croak 'Missing first_name' unless $first_name;
- croak 'Missing last_name' unless $last_name;
- croak 'Missing learner_id' unless $learner_id;
+ croak 'Missing course_id' unless defined $course_id && length $course_id;
+ croak 'Missing registration_id'
+ unless defined $registration_id && length $registration_id;
+ croak 'Missing first_name' unless defined $first_name && length $first_name;
+ croak 'Missing last_name' unless defined $last_name && length $last_name;
+ croak 'Missing learner_id' unless defined $learner_id && length $learner_id;
$opts ||= {};

0 comments on commit 212f3da

Please sign in to comment.