diff --git a/modules/core/lib/ModuleDefinition.php b/modules/core/lib/ModuleDefinition.php
index 5603c90023bc37023aaf65e19387614922af78ae..64106e628940b70d180a434058276f974d5bc605 100644
--- a/modules/core/lib/ModuleDefinition.php
+++ b/modules/core/lib/ModuleDefinition.php
@@ -2,7 +2,7 @@
 
 
 /**
- * Represents a definitino of a module.
+ * Represents a definition of a module.
  * Is usually read and parsed from a JSON definition file.
  *
  * @Author	Andreas Ă…kre Solberg, <andreas.solberg@uninett.no>
@@ -43,6 +43,9 @@ class sspmod_core_ModuleDefinition {
 			
 		} elseif(preg_match('|^http(s)?://.*$|', $id)) {
 			$defraw = file_get_contents($id);
+			if ( $defraw === FALSE ) {
+				throw new Exception('Error while downloading module definition [' . $id . ']');
+			}
 			$def = json_decode($defraw, TRUE);
 		} else {
 			throw new Exception('Could not resolve [' . $id . '] as URL nor module identifier.');