Browse Source

bug fix: publish key history for the first time

Carsten Porth 5 years ago
parent
commit
0484ee0ef6
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/src/providers/crypto/crypto.ts

+ 4 - 1
app/src/providers/crypto/crypto.ts

@@ -68,6 +68,9 @@ export class CryptoProvider {
 
     // Get tweet with link to key history
     const tweetId = this.extractTweetId(profileDescription);
+    if (tweetId.length === 0) {
+      return null;
+    }
     const tweetWithKeyHistoryLink = await this.twitter.fetchTweet(tweetId);
 
     // Extract link to public key
@@ -86,7 +89,7 @@ export class CryptoProvider {
     }
   }
 
-  private extractTweetId(text: string) {
+  private extractTweetId(text: string): string {
     for (let word of text.split(" ")) {
       if (this.isTweetId(word)) {
         return word.substr(8);