File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
driver-core/src/main/com/mongodb/connection Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2525import org .bson .codecs .EncoderContext ;
2626import org .bson .io .BasicOutputBuffer ;
2727
28- import java .io .IOException ;
2928import java .net .JarURLConnection ;
3029import java .net .URL ;
3130import java .nio .charset .Charset ;
@@ -113,9 +112,11 @@ private static String getDriverVersion() {
113112 JarURLConnection jarURLConnection = (JarURLConnection ) jarUrl .openConnection ();
114113 Manifest manifest = jarURLConnection .getManifest ();
115114 String version = (String ) manifest .getMainAttributes ().get (new Attributes .Name ("Build-Version" ));
116- driverVersion = version ;
115+ if (version != null ) {
116+ driverVersion = version ;
117+ }
117118 }
118- } catch (IOException e ) {
119+ } catch (Exception e ) {
119120 // do nothing
120121 }
121122 return driverVersion ;
You can’t perform that action at this time.
0 commit comments