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 25
25
import org .bson .codecs .EncoderContext ;
26
26
import org .bson .io .BasicOutputBuffer ;
27
27
28
- import java .io .IOException ;
29
28
import java .net .JarURLConnection ;
30
29
import java .net .URL ;
31
30
import java .nio .charset .Charset ;
@@ -113,9 +112,11 @@ private static String getDriverVersion() {
113
112
JarURLConnection jarURLConnection = (JarURLConnection ) jarUrl .openConnection ();
114
113
Manifest manifest = jarURLConnection .getManifest ();
115
114
String version = (String ) manifest .getMainAttributes ().get (new Attributes .Name ("Build-Version" ));
116
- driverVersion = version ;
115
+ if (version != null ) {
116
+ driverVersion = version ;
117
+ }
117
118
}
118
- } catch (IOException e ) {
119
+ } catch (Exception e ) {
119
120
// do nothing
120
121
}
121
122
return driverVersion ;
You can’t perform that action at this time.
0 commit comments