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
Post a Comment