[valadoc] libvaladoc/importer: Fix runtime warning in valadoc-importer. (Parser.parse: content != null)



commit 265d47ab19bc008c45b5a214c69d61caa75e2da2
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Oct 28 19:33:07 2010 +0200

    libvaladoc/importer: Fix runtime warning in valadoc-importer. (Parser.parse: content != null)

 .../importer/valadocdocumentationimporter.vala     |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/libvaladoc/importer/valadocdocumentationimporter.vala b/src/libvaladoc/importer/valadocdocumentationimporter.vala
index ee6ef02..2f11f44 100644
--- a/src/libvaladoc/importer/valadocdocumentationimporter.vala
+++ b/src/libvaladoc/importer/valadocdocumentationimporter.vala
@@ -137,7 +137,10 @@ public class Valadoc.Importer.ValadocDocumentationImporter : DocumentationImport
 		try {
 			_filename = filename;
 			_mapped_file = new MappedFile (filename, false);
-			_parser.parse ((string) _mapped_file.get_contents (), filename, 0, 0);
+			var content = _mapped_file.get_contents ();
+			if (content != null) {
+				_parser.parse ((string) content, filename, 0, 0);
+			}
 		} catch (FileError err) {
 			reporter.simple_error ("Unable to map file `%s': %s".printf (filename, err.message));
 		} catch (ParserError err) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]