You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@submarine.apache.org by GitBox <gi...@apache.org> on 2021/09/12 17:44:29 UTC

[GitHub] [submarine] pingsutw commented on a change in pull request #746: SUBMARINE-1004 NullPointerException could be thrown in NotebookSpecParser.java

pingsutw commented on a change in pull request #746:
URL: https://github.com/apache/submarine/pull/746#discussion_r706870166



##########
File path: submarine-server/server-submitter/submitter-k8s/src/main/java/org/apache/submarine/server/submitter/k8s/parser/NotebookSpecParser.java
##########
@@ -100,7 +100,16 @@ private static V1PodTemplateSpec parseTemplateSpec(NotebookSpec notebookSpec) {
     container.addEnvItem(submarineServerPortEnv);
 
     // Environment
+    boolean environmentsExist = true;
+    boolean environmentsSpecExist = true;
     if (getEnvironment(notebookSpec) != null) {
+      environmentsExist = false;
+      environmentsSpecExist = false;
+    } else if (getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
+      environmentsSpecExist = false;
+    }
+
+    if (environmentsExist && environmentsSpecExist) {

Review comment:
       ```suggestion
       if (getEnvironment(notebookSpec) != null && getEnvironment(notebookSpec).getEnvironmentSpec() != null) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@submarine.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org