title: TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string | UrlTree'
body: <p>The title of this question is the message what the Angular CLI compiler throws.</p>
  <p>I have this constructor in my app.component.ts:</p>
  <pre><code>    export class AppComponent {
        constructor(private userService: UserService, private auth: AuthService, router: Router) {
         auth.user$.subscribe(user =&gt; {
          if (user) {
           userService.save(user);
  
           let returnUrl = localStorage.getItem('returnUrl');
           router.navigateByUrl(returnUrl);
        }
      });
    }
  }
  </code></pre>
  <p>In the above attached code part I have the 'returnURL' underlined and if I take the cursor above it says:</p>
  <blockquote>
  <p>&quot;Argument of type 'string | null' is not assignable to parameter of type 'string | UrlTree'.
  Type 'null' is not assignable to type 'string | UrlTree'.&quot;</p>
  </blockquote>
  <p>I have a user.service.ts which is related to Firebase:</p>
  <pre><code>    import { Injectable } from '@angular/core';
      import { AngularFireDatabase } from 'angularfire2/database';
      import * as firebase from 'firebase';
  
      @Injectable()
      export class UserService {
  
          constructor(private db: AngularFireDatabase) { }
    
            save(user: firebase.User) {
            this.db.object('/users/' + user.uid).update({
              name: user.displayName,
              email: user.email
           });
         }
       }
  
  </code></pre>
  <p>Does anyone has an idea about what is the compiler's problem here? I also attached the console message.</p>
  <p><a href="https://i.stack.imgur.com/ThNDx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ThNDx.png" alt="Console message" /></a></p>