Saving a C++ file in a non-C++ project triggered an exception.

This fixes a minor bug: when you try to save a .cpp file that belongs to a non-C++ project an exception is triggered.