If this had happened in 2008, and Obama was not chosen, we would have had riots.
It's highly unlikely for this to happen if a candidate has a popular majority. There has only been one presidential candidate who actually won a majority of the popular vote who failed to win a majority in the electoral college. That was Tilden who won 51% of the popular vote in 1876, but even then you should consider that was mostly because, racked up huge margins in former confederate states with margins up to 90% while losing most of the rest of the states. The electoral college penalizes a candidate or party that only has a regional appeal or who loses more states.
Every other time a presidential candidate has won the popular vote and lost the electoral college or has lost in the House of representatives, the candidate winning the popular vote only got a plurality. In 1824 there really wasn't a nationwide popular vote for president. There were large states like New York that didn't even have a popular vote for president. In 1888, incumbent president Grover Cleveland got less than a majority. In 2000, both Bush and Gore had less than a majority.
We’ve had riots before and we’ll have riots again. Our first riots were in 1791 when citizens rose up against federal taxes, the Whiskey Rebellion.