title: java.util.NoSuchElementException: The source Publisher is empty
body: <p>I have problem with exception </p>
  
  <blockquote>
    <p>getCurrentUpdateDateFromStorage() java.util.NoSuchElementException: The source Publisher is empty</p>
  </blockquote>
  
  <p>The code was working for a long time and today I have this issue.</p>
  
  <pre><code>  private fun getCurrentUpdateDateFromStorage(sentDate: Date) {
      LogMgr.d(TAG, "getCurrentUpdateDateFromStorage()")
      val flotaUserId = getCurrentFlotaUserId()
  
      if (flotaUserId &gt; 0) {
          compositeDisposable.add(wfmStorageDomain.getLastUpdateDate(flotaUserId)
                  .subscribe(
                          { lastLocalUpdateDate -&gt;
                              LogMgr.d(TAG, "lastLocalUpdateDate: $lastLocalUpdateDate, time: " + (lastLocalUpdateDate?.time
                                      ?: "null"))
                              if (lastLocalUpdateDate == null || lastLocalUpdateDate.time &lt; sentDate.time) {
                                  LogMgr.d(TAG, "update needs to be done")
                                  updateEventPlannersFromServer(lastLocalUpdateDate)
                              } else {
                                  LogMgr.d(TAG, "update not necessary, or invalid data -&gt; localDate:$lastLocalUpdateDate : sentDate:$sentDate")
                              }
                          },
                          { error -&gt;
                              LogMgr.e(TAG, "getCurrentUpdateDateFromStorage() $error")
                          }))
      } else {
          LogMgr.e(TAG, "getCurrentUpdateDateFromStorage() Invalid flotaUserId:$flotaUserId")
      }
  }
  </code></pre>
  
  <p>================= </p>
  
  <pre><code>   override fun getLastUpdateDate(flotaUserId: Int): Single&lt;Date&gt; {
      LogMgr.d(TAG, "getLastUpdateDate(): $flotaUserId")
      return Single.fromPublisher({ subscriber -&gt;
          RXSQLite.rx(
                  SQLite.select().from(EventPlanner::class.java)
                          .orderBy(EventPlanner_Table.sentDate, false))
                  .queryList()
                  .subscribeOn(getSubscriptionScheduler())
                  .subscribe({ eventPlanner -&gt;
                      LogMgr.d(TAG, "getLastUpdateDate() $eventPlanner")
  
                      if (eventPlanner.isEmpty()) {
                          subscriber.onNext(Date(0L))
                      } else {
                          subscriber.onNext(eventPlanner[0].sentDate)
                      }
                      subscriber.onComplete()
                  }, { error -&gt;
                      LogMgr.e(TAG, "getLastUpdateDate()", error)
                      subscriber.onError(error)
                  })
      })
  }
  </code></pre>
  
  <p>Any idea how to fix it ? 
  <strong>Thanks for any advice and tips.</strong></p>
  
  <p>EDIT: StackTrace</p>
  
  <blockquote>
  <pre><code>java.util.NoSuchElementException: The source Publisher is empty
      at io.reactivex.internal.operators.single.SingleFromPublisher$ToSingleObserver.onComplete(SingleFromPublisher.java:99)
      at com.fs.wfm.storage.dbflow.DBFlowWfmStorageRepo$getLastUpdateDate$1$1.accept(DBFlowWfmStorageRepo.kt:211)
      at com.fs.wfm.storage.dbflow.DBFlowWfmStorageRepo$getLastUpdateDate$1$1.accept(DBFlowWfmStorageRepo.kt:22)
      at io.reactivex.internal.observers.ConsumerSingleObserver.onSuccess(ConsumerSingleObserver.java:63)
      at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.onSuccess(SingleSubscribeOn.java:68)
      at io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:56)
      at io.reactivex.Single.subscribe(Single.java:3310)
      at io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
      at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
      at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
      at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
      at java.lang.Thread.run(Thread.java:764)
  </code></pre>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/GR12E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GR12E.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/kIJyM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kIJyM.png" alt="enter image description here"></a></p>