Your first getline, right?
OK, I'd advise that you not mix the use of cin and getline. Getline absorbs newlines while cin doesn't, so here's what happens.
You input the data to cin and then you press enter. cin takes the data and puts it into the variable, leaving the newline. When you get to the getline, getline accepts newlines so it immediately takes the newline. But since getline discards the marker character at which input stops it does not assign it to the string so your string remains null.
The solution is to stick to either cin or getline. One or the other, but not both. It causes confusions in the input buffer.