Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
ITAGeo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Institute of Technical Acoustics (ITA)
ITAGeo
Commits
9ce1279c
Commit
9ce1279c
authored
Jul 18, 2019
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing a problem if JSON node does not exist
parent
7a62cf58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
src/ITAGeo/Base.cpp
src/ITAGeo/Base.cpp
+13
-6
No files found.
src/ITAGeo/Base.cpp
View file @
9ce1279c
...
...
@@ -195,9 +195,12 @@ void ITAGeo::CEmitter::LoadFromJSONString( const std::string& sContent, std::sha
//Set the orientation
qOrient
.
SetValues
(
dOrientation
);
std
::
string
sDirectivityID
=
jnRoot
.
at
(
"directivity_id"
).
as_string
();
if
(
pResourceManager
&&
pResourceManager
->
HasDirectivity
(
sDirectivityID
)
)
pDirectivity
=
pResourceManager
->
GetDirectivity
(
sDirectivityID
);
if
(
jnRoot
.
find
(
"directivity_id"
)
!=
jnRoot
.
end
()
)
{
std
::
string
sDirectivityID
=
jnRoot
.
at
(
"directivity_id"
).
as_string
();
if
(
pResourceManager
&&
pResourceManager
->
HasDirectivity
(
sDirectivityID
)
)
pDirectivity
=
pResourceManager
->
GetDirectivity
(
sDirectivityID
);
}
#endif
}
...
...
@@ -304,9 +307,13 @@ void ITAGeo::CSensor::LoadFromJSONString( const std::string& sContent, std::shar
//Set the orientation
qOrient
.
SetValues
(
dOrientation
);
std
::
string
sDirectivityID
=
(
std
::
string
)
jnRoot
.
at
(
"directivity_id"
).
as_string
();
if
(
pResourceManager
->
HasDirectivity
(
sDirectivityID
)
)
pDirectivity
=
pResourceManager
->
GetDirectivity
(
sDirectivityID
);
if
(
jnRoot
.
find
(
"directivity_id"
)
!=
jnRoot
.
end
()
)
{
std
::
string
sDirectivityID
=
(
std
::
string
)
jnRoot
.
at
(
"directivity_id"
).
as_string
();
if
(
pResourceManager
->
HasDirectivity
(
sDirectivityID
)
)
pDirectivity
=
pResourceManager
->
GetDirectivity
(
sDirectivityID
);
}
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment