c# - int.Parse Value cannot be null for non-null string -



c# - int.Parse Value cannot be null for non-null string -

despite checking whether input string not null or empty, i'm getting value cannot null exception when parsing string integer. haven't debugged yet actual value beingness passed function because have if not string null or empty before seek parse.

int groupcredits = 0; if (!string.isnullorempty(course.credits)) groupcredits += int.parse(course.credits);

exception:

system.argumentnullexception: value cannot null. parameter name: string @ system.number.stringtonumber(string str, numberstyles options, numberbuffer& number, numberformatinfo info, boolean parsedecimal) @ system.number.parseint32(string s, numberstyles style, numberformatinfo info) @ system.int32.parse(string s)

c#

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -