File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/com/cisco/trex/stateful Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 2020import java .security .MessageDigest ;
2121import java .security .NoSuchAlgorithmException ;
2222import java .util .ArrayList ;
23+ import java .util .Collections ;
2324import java .util .HashMap ;
2425import java .util .HashSet ;
2526import java .util .LinkedHashMap ;
@@ -401,6 +402,11 @@ public List<String> getTemplateGroupNames() {
401402 * @return template group names
402403 */
403404 public List <String > getTemplateGroupNames (String profileId ) {
405+ if (profileId == null || !getProfileIds ().contains (profileId )) {
406+ LOGGER .warn ("can not fetch template group names due to invalid profileId, or relative profile is not loaded yet." );
407+ return Collections .emptyList ();
408+ }
409+
404410 Map <String , Object > payload = createPayload (profileId );
405411 payload .put ("initialized" , false );
406412 String json = callMethod ("get_tg_names" , payload );
You can’t perform that action at this time.
0 commit comments