File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1+ [ ![ Travis branch] ( https://img.shields.io/travis/twilio/twilio-php/master.svg )] ( https://travis-ci.org/twilio/twilio-php/branches )
2+ [ ![ NuGet] ( https://img.shields.io/nuget/v/Twilio.svg )] ( https://www.nuget.org/packages/Twilio )
3+ [ ![ NuGet Pre Release] ( https://img.shields.io/nuget/vpre/Twilio.svg?label=nuget ( alpha ))] ( https://www.nuget.org/packages/Twilio )
4+
15# Twilio REST API and TwiML Libraries for .NET
26
37Twilio provides a simple HTTP-based API for sending and receiving phone calls and text messages. Learn more at [ http://www.twilio.com ] [ 0 ]
Original file line number Diff line number Diff line change @@ -142,14 +142,19 @@ record => JsonConvert.DeserializeObject<T>(record.ToString())
142142 var uriNode = root [ "uri" ] ;
143143 if ( uriNode != null )
144144 {
145+ JToken pageSize ;
146+ JToken firstPageUri ;
147+ JToken nextPageUri ;
148+ JToken previousPageUri ;
149+
145150 // v2010 API
146151 return new Page < T > (
147152 parsedRecords ,
148- root [ "page_size" ] . Value < int > ( ) ,
153+ root . TryGetValue ( "page_size" , out pageSize ) ? root [ "page_size" ] . Value < int > ( ) : parsedRecords . Count ,
149154 uri : uriNode . Value < string > ( ) ,
150- firstPageUri : root [ "first_page_uri" ] . Value < string > ( ) ,
151- nextPageUri : root [ "next_page_uri" ] . Value < string > ( ) ,
152- previousPageUri : root [ "previous_page_uri" ] . Value < string > ( )
155+ firstPageUri : root . TryGetValue ( "first_page_uri" , out firstPageUri ) ? root [ "first_page_uri" ] . Value < string > ( ) : null ,
156+ nextPageUri : root . TryGetValue ( "next_page_uri" , out nextPageUri ) ? root [ "next_page_uri" ] . Value < string > ( ) : null ,
157+ previousPageUri : root . TryGetValue ( "previous_page_uri" , out previousPageUri ) ? root [ "previous_page_uri" ] . Value < string > ( ) : null
153158 ) ;
154159 }
155160
You can’t perform that action at this time.
0 commit comments