@@ -46,6 +46,14 @@ public static void loadConfiguration() {
4646 logger .info ("The configuration of the git module was interrupted because the project '" + config .getIgnitionProjectName () + "' already exist." );
4747 return ;
4848 }
49+
50+ if (config .getRepoURI () == null || config .getRepoBranch () == null
51+ || config .getIgnitionProjectName () == null || config .getIgnitionUserName () == null
52+ || config .getUserName () == null || (config .getUserPassword () == null && config .getSshKey () == null )
53+ || config .getUserEmail () == null ){
54+ throw new RuntimeException ("Incomplete git configuration file." );
55+ }
56+
4957 projectManager .createProject (config .getIgnitionProjectName (), new ProjectManifest (config .getIgnitionProjectName (), "" , false , false , "" ), new ArrayList ());
5058
5159 Path projectDir = getProjectFolderPath (config .getIgnitionProjectName ());
@@ -113,7 +121,7 @@ public static void loadConfiguration() {
113121 }
114122
115123
116- static protected GitCommissioningConfig parseConfigLines (byte [] ignitionConf ) throws Exception {
124+ static protected GitCommissioningConfig parseConfigLines (byte [] ignitionConf ) {
117125 Pattern repoUriPattern = Pattern .compile ("repo.uri" );
118126 Pattern repoBranchPattern = Pattern .compile ("repo.branch" );
119127
@@ -169,6 +177,8 @@ static protected GitCommissioningConfig parseConfigLines(byte[] ignitionConf) th
169177 config .setSecretFromFilePath (Paths .get (line .split ("=" )[1 ]), true );
170178 }
171179 }
180+ } catch (ArrayIndexOutOfBoundsException e ) {
181+ throw new RuntimeException ("Invalid git configuration file." , e );
172182 } catch (Exception e ) {
173183 logger .error ("An error occurred while importing the Git configuration file." , e );
174184 throw new RuntimeException (e );
0 commit comments