diff --git a/modules/io/src/seq/clustal_io_handler.cc b/modules/io/src/seq/clustal_io_handler.cc
index a02fa7682805ea564ed22e0d055f80f474ffb509..50689f947a05361d684646994b9188aa4a8ea2a7 100644
--- a/modules/io/src/seq/clustal_io_handler.cc
+++ b/modules/io/src/seq/clustal_io_handler.cc
@@ -76,6 +76,10 @@ void ClustalIOHandler::Import(seq::SequenceList& aln,
   typedef std::map<String, seq::SequenceHandle> SeqMap;
   std::vector<seq::SequenceHandle> order;
   SeqMap seq_map;
+  if (!instream) {
+    throw IOException("Can't import CLUSTAL alignment. Inexisting file "
+                      "or invalid stream.");
+  }
   if (!std::getline(instream, line) || line.find("CLUSTAL")!=0) {
     throw IOException("bad CLUSTAL file. First line must contain CLUSTAL");
   }