@@ -520,11 +520,6 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
520
520
for (std::string const & attribute: _json.getMemberNames ())
521
521
solRequire (validMembers.count (attribute), AssemblyImportException, " Unknown attribute '" + attribute + " '." );
522
522
523
- solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' is missing." );
524
- solRequire (_json[" .code" ].isArray (), AssemblyImportException, " Member '.code' is not an array." );
525
- for (Json::Value const & codeItem: _json[" .code" ])
526
- solRequire (codeItem.isObject (), AssemblyImportException, " The '.code' array contains an item that is not an object." );
527
-
528
523
if (_level == 0 )
529
524
{
530
525
if (_json.isMember (" sourceList" ))
@@ -559,7 +554,13 @@ std::pair<std::shared_ptr<Assembly>, std::vector<std::string>> Assembly::fromJSO
559
554
else
560
555
sourceList = _sourceList;
561
556
557
+ solRequire (_json.isMember (" .code" ), AssemblyImportException, " Member '.code' is missing." );
558
+ solRequire (_json[" .code" ].isArray (), AssemblyImportException, " Member '.code' is not an array." );
559
+ for (Json::Value const & codeItem: _json[" .code" ])
560
+ solRequire (codeItem.isObject (), AssemblyImportException, " The '.code' array contains an item that is not an object." );
561
+
562
562
result->importAssemblyItemsFromJSON (_json[" .code" ], sourceList);
563
+
563
564
if (_json[" .auxdata" ])
564
565
{
565
566
solRequire (_json[" .auxdata" ].isString (), AssemblyImportException, " Optional member '.auxdata' is not a string." );
0 commit comments