File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/io/cdap/plugin Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -160,8 +160,9 @@ public void validate() {
160160 if (!containsMacro (MongoDBConstants .HOST ) && Strings .isNullOrEmpty (host )) {
161161 throw new InvalidConfigPropertyException ("Host must be specified" , MongoDBConstants .HOST );
162162 }
163- if ((!containsMacro (MongoDBConstants .CONNECT_USING_SRV_STRING ) && !connectUsingSRVString ) &&
164- !containsMacro (MongoDBConstants .PORT )) {
163+ if (!containsMacro (MongoDBConstants .PORT ) && port != null && !containsMacro (
164+ MongoDBConstants .CONNECT_USING_SRV_STRING ) && connectUsingSRVString != null && !connectUsingSRVString ) {
165+ // Port is not required when SRV is used
165166 if (port < 1 ) {
166167 throw new InvalidConfigPropertyException ("Port number must be greater than 0" , MongoDBConstants .PORT );
167168 }
You can’t perform that action at this time.
0 commit comments