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