diff --git a/Post/PViewIO.cpp b/Post/PViewIO.cpp index ab4bfdee36dfd764fbe295f3c6f1759dc6f984b3..7589fe8ea544d53b97463c67ea7b6fab325d9d50 100644 --- a/Post/PViewIO.cpp +++ b/Post/PViewIO.cpp @@ -88,6 +88,12 @@ bool PView::readMSH(std::string fileName, int fileIndex) return false; } + GModel *model = GModel::current(); + if(model->empty()){ + Msg::Error("Model is empty: please load a mesh before loading the dataset"); + return false; + } + char str[256] = "XXX"; int index = -1; bool binary = false, swap = false;