diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs
index 5f3689de..e1afb2f1 100644
--- a/websocket-sharp/Ext.cs
+++ b/websocket-sharp/Ext.cs
@@ -808,22 +808,24 @@ namespace WebSocketSharp
}
///
- /// Tries to create a for WebSocket with the specified
- /// .
+ /// Tries to create a for WebSocket with
+ /// the specified .
///
///
/// true if a is successfully created; otherwise, false.
///
///
- /// A that represents the WebSocket URL to try.
+ /// A that represents a WebSocket URL to try.
///
///
- /// When this method returns, a that represents the WebSocket URL
- /// if is valid; otherwise, .
+ /// When this method returns, a that represents
+ /// a WebSocket URL if is valid;
+ /// otherwise, .
///
///
- /// When this method returns, a that represents the error message
- /// if is invalid; otherwise, .
+ /// When this method returns, a that represents
+ /// an error message if is invalid;
+ /// otherwise, .
///
internal static bool TryCreateWebSocketUri (
this string uriString, out Uri result, out string message)
@@ -831,7 +833,7 @@ namespace WebSocketSharp
result = null;
var uri = uriString.ToUri ();
- if (!uri.IsAbsoluteUri) {
+ if (uri == null || !uri.IsAbsoluteUri) {
message = "Not an absolute URI: " + uriString;
return false;
}
@@ -1719,11 +1721,11 @@ namespace WebSocketSharp
///
public static Uri ToUri (this string uriString)
{
- Uri res;
- return Uri.TryCreate (
- uriString, uriString.MaybeUri () ? UriKind.Absolute : UriKind.Relative, out res)
- ? res
- : null;
+ Uri ret;
+ Uri.TryCreate (
+ uriString, uriString.MaybeUri () ? UriKind.Absolute : UriKind.Relative, out ret);
+
+ return ret;
}
///