Repository: quarkusio/quarkus
Issue: MongoDb Srv connection does not work on windows

### Describe the bug

For the windows project, when you run the application with the maven commande
 mvn compile quarkus:dev -Dquarkus.profile=local

The application failed to open a mongo connection with the SRV protocol.
"/etc/resolv.conf"

### Expected behavior

The mongodb SRV protocol should work out of the box

### Actual behavior

we have a great stack trace with NPE : 

```
2022-10-14 18:17:06,767 ERROR [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (executor-thread-0) Request failed: java.lang.NullPointerException: Cannot invoke "java.util.List.isEmpty()" because "list" is null
	at io.quarkus.mongodb.runtime.dns.MongoDnsClient.lambda$new$0(MongoDnsClient.java:58)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at io.quarkus.mongodb.runtime.dns.MongoDnsClient.<init>(MongoDnsClient.java:56)
	at io.quarkus.mongodb.runtime.dns.MongoDnsClientProvider.create(MongoDnsClientProvider.java:12)
	at com.mongodb.internal.dns.DefaultDnsResolver.<init>(DefaultDnsResolver.java:44)
	at com.mongodb.ConnectionString.<init>(ConnectionString.java:397)
	at io.quarkus.mongodb.runtime.MongoClients.createMongoConfiguration(MongoClients.java:262)
	at io.quarkus.mongodb.runtime.MongoClients.createMongoClient(MongoClients.java:118)
	at io.quarkus.mongodb.runtime.MongoClients_Subclass.createMongoClient$$superforward1(Unknown Source)
	at io.quarkus.mongodb.runtime.MongoClients_Subclass$$function$$4.apply(Unknown Source)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:53)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.proceed(InvocationInterceptor.java:62)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor.monitor(InvocationInterceptor.java:49)
	at io.quarkus.arc.runtime.devconsole.InvocationInterceptor_Bean.intercept(Unknown Source)
	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:41)
	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:40)
	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:32)
	at io.quarkus.mongodb.runtime.MongoClients_Subclass.createMongoClient(Unknown Source)
	at io.quarkus.mongodb.runtime.MongoClientRecorder.lambda$mongoClientSupplier$0(MongoClientRecorder.java:63)
	at io.quarkus.mongodb.runtime.MongoClientRecorder$MongoClientSupplier.get(MongoClientRecorder.java:57)
	at com.mongodb.client.MongoClient_38bcba43bbcf7928744e8baa654420f551f1ff9a_Synthetic_Bean.create(Unknown Source)
	at com.mongodb.client.MongoClient_38bcba43bbcf7928744e8baa654420f551f1ff9a_Synthetic_Bean.create(Unknown Source)
	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:111)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
	at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:32)
	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
	at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:32)
	at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:19)
	at com.mongodb.client.MongoClient_38bcba43bbcf7928744e8baa654420f551f1ff9a_Synthetic_ClientProxy.arc$delegate(Unknown Source)
	at com.mongodb.client.MongoClient_38bcba43bbcf7928744e8baa654420f551f1ff9a_Synthetic_ClientProxy.getDatabase(Unknown Source)
```

### How to Reproduce?

Step to reproduce the behaviour : 

1. Having a windows environment or not having the right to read this file ( "/etc/resolv.conf")
2. try to connect a mongodb with srv protocole  ( url connection must start with mongodb+srv) 
3. try to open the connection, the NPE rise !

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

Java version: 17.0.1

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.12.0

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Apache Maven 3.8.1 

### Additional information

You should not initialize a list with null 

List<String> nameServers = null;

should be                 nameServers = new ArrayList<>();


Changed files:
extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java

diff --git a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
index e12c70dc854..d20705bedae 100644
--- a/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
+++ b/extensions/mongodb-client/runtime/src/main/java/io/quarkus/mongodb/runtime/dns/MongoDnsClient.java
@@ -8,6 +8,7 @@
 import java.nio.file.Paths;
 import java.time.Duration;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -82,7 +83,7 @@ public class MongoDnsClient implements DnsClient {
 
     private static List<String> nameServers() {
         Path conf = Paths.get("/etc/resolv.conf");
-        List<String> nameServers = null;
+        List<String> nameServers = Collections.emptyList();
         if (Files.exists(conf)) {
             try (Stream<String> lines = Files.lines(conf)) {
                 nameServers = lines
@@ -91,7 +92,6 @@ private static List<String> nameServers() {
                         .collect(Collectors.toList());
             } catch (IOException | ArrayIndexOutOfBoundsException e) {
                 Logger.getLogger(MongoDnsClientProvider.class).info("Unable to read the /etc/resolv.conf file", e);
-                nameServers = new ArrayList<>();
             }
         }
         return nameServers;