Skip to content

Commit

Permalink
Need to check for nil as well
Browse files Browse the repository at this point in the history
git-svn-id: http://matlab-ruby.rubyforge.org/svn/trunk@2 a4cadce9-4ec9-48b2-9120-f971c031a6cc
  • Loading branch information
poogle committed Apr 27, 2007
1 parent 621a445 commit 51727ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/matlab/driver/native/conversions.rb
Expand Up @@ -165,7 +165,7 @@ def self.from_matlab(matrix)
n.times do |column_index|
names.each do |name|
value = Matlab::Driver::Native::API.mxGetField(matrix, index, name)
struct_matrix[row_index, column_index][name] = (Matlab::Driver::Native::API.mxIsEmpty(value) || value.to_ruby.to_s == nil.to_matlab.to_s ? nil : value.to_ruby)
struct_matrix[row_index, column_index][name] = (value.nil? || Matlab::Driver::Native::API.mxIsEmpty(value) || value.to_ruby.to_s == nil.to_matlab.to_s ? nil : value.to_ruby)
end
index += 1
end
Expand Down

0 comments on commit 51727ce

Please sign in to comment.