             inputFile = getOption(args, option: "-input")
         }
         if (inputFile != nil) {
-            result = fromJSONFile(inputFile!)
+            result = fromJSONFile(inputFile!) ?? [:]
         }
         
-        if (result != nil) {
-            consume(result!, type: compileType, outputFile: outputClassFile!)
+        if (result.isEmpty == false) {
+            consume(result, type: compileType, langOutputFile: outputClassFile!)
         }
         else {
             print("Error: missing input file")

            }
            outputStr.appendContentsOf(genString + "\n")
            do {
                try outputStr.writeToFile(outputFile, atomically: true, encoding: NSUTF8StringEncoding)
            }
            catch {
                print("Error: writing to \(outputFile)")
            }
        }
    }

        }
    }
    
    private func consume(data: Dictionary <String, AnyObject>, type: LangType, langOutputFile: String) -> Void
    {
        createFolderForFile(langOutputFile)

        // process first pass keys
        for (key, value) in data {
            if (key == keySchemaVersion) {
