summaryrefslogtreecommitdiff
path: root/Postman
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2020-01-21 20:34:49 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2020-01-21 20:34:49 +0000
commit4a3189d1c46a014c32365523e0f18b91bca92ed4 (patch)
treedbee37e447837d4670ce82287da3c6eafd384043 /Postman
parent5ca998ddd8427110b1b7eec3261c5ccf3a94fb12 (diff)
downloadPost-SMTP-4a3189d1c46a014c32365523e0f18b91bca92ed4.zip
undefined notifications and version bump
Diffstat (limited to 'Postman')
-rw-r--r--Postman/PostmanOAuthToken.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/Postman/PostmanOAuthToken.php b/Postman/PostmanOAuthToken.php
index 1cd9634..81efbfe 100644
--- a/Postman/PostmanOAuthToken.php
+++ b/Postman/PostmanOAuthToken.php
@@ -45,10 +45,26 @@ if (! class_exists ( 'PostmanOAuthToken.php' )) {
*/
private function load() {
$a = get_option ( PostmanOAuthToken::OPTIONS_NAME );
- $this->setAccessToken ( $a [PostmanOAuthToken::ACCESS_TOKEN] );
- $this->setRefreshToken ( $a [PostmanOAuthToken::REFRESH_TOKEN] );
- $this->setExpiryTime ( $a [PostmanOAuthToken::EXPIRY_TIME] );
- $this->setVendorName ( $a [PostmanOAuthToken::VENDOR_NAME] );
+
+ if ( ! is_array( $a ) ) {
+ return;
+ }
+
+ if ( isset( $a [PostmanOAuthToken::ACCESS_TOKEN] ) ) {
+ $this->setAccessToken ( $a [PostmanOAuthToken::ACCESS_TOKEN] );
+ }
+
+ if ( isset( $a [PostmanOAuthToken::REFRESH_TOKEN] ) ) {
+ $this->setRefreshToken($a [PostmanOAuthToken::REFRESH_TOKEN]);
+ }
+
+ if ( isset( $a [PostmanOAuthToken::EXPIRY_TIME] ) ) {
+ $this->setExpiryTime($a [PostmanOAuthToken::EXPIRY_TIME]);
+ }
+
+ if ( isset( $a [PostmanOAuthToken::VENDOR_NAME] ) ) {
+ $this->setVendorName($a [PostmanOAuthToken::VENDOR_NAME]);
+ }
}
/**