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