File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
java/src/org/openqa/selenium/remote Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -114,19 +114,20 @@ public Map<String, Object> encode(Throwable throwable) {
114
114
}
115
115
116
116
if (throwable instanceof UnhandledAlertException ) {
117
- Map <String , String > data =
118
- Map .of ("text" , ((UnhandledAlertException ) throwable ).getAlertText ());
119
- return Map .of (
120
- "value" ,
121
- Map .of (
122
- "error" ,
123
- err .w3cErrorString ,
124
- "message" ,
125
- message ,
126
- "stacktrace" ,
127
- stacktrace .toString (),
128
- "data" ,
129
- data ));
117
+ String text = ((UnhandledAlertException ) throwable ).getAlertText ();
118
+ if (text != null ) {
119
+ return Map .of (
120
+ "value" ,
121
+ Map .of (
122
+ "error" ,
123
+ err .w3cErrorString ,
124
+ "message" ,
125
+ message ,
126
+ "stacktrace" ,
127
+ stacktrace .toString (),
128
+ "data" ,
129
+ Map .of ("text" , text )));
130
+ }
130
131
}
131
132
132
133
return Map .of (
You can’t perform that action at this time.
0 commit comments