getline() extracts data up to the terminating delimiter (\n unless specified) and then extracts and discards the delimeter.
>> ignores any preceding white space chars and then extracts up to the first white-space char which is NOT extracted.
Hence if you have a getline() following a >> then the white-space char terminating the >> is considered as input for the getline(). If this is the getline() terminating char then getline() will return with empty input.
One way around this is use cin.ignore() after the final >> before a getline().