Fixed a glaring bug in the Scheduler causing errors when the scheduler's last item in the queue is cancelled
git-svn-id: file:///srv/devel/repo-conversion/nusu@152 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
		
							parent
							
								
									b38284d372
								
							
						
					
					
						commit
						f8adca9e17
					
				
					 1 changed files with 6 additions and 7 deletions
				
			
		|  | @ -465,17 +465,16 @@ namespace Nuclex.Support.Scheduling { | |||
|     /// <summary>Retrieves the notification that is due next</summary> | ||||
|     /// <returns>The notification that is due next</returns> | ||||
|     private Notification getNextDueNotification() { | ||||
|       if(this.notifications.Count == 0) { | ||||
|         return null; | ||||
|       } else { | ||||
|       while(this.notifications.Count > 0) { | ||||
|         Notification nextDueNotification = this.notifications.Peek(); | ||||
|         while(nextDueNotification.Cancelled) { | ||||
|         if(nextDueNotification.Cancelled) { | ||||
|           this.notifications.Dequeue(); | ||||
|           nextDueNotification = this.notifications.Peek(); | ||||
|         } else { | ||||
|           return nextDueNotification; | ||||
|         } | ||||
| 
 | ||||
|         return nextDueNotification; | ||||
|       } | ||||
| 
 | ||||
|       return null; | ||||
|     } | ||||
| 
 | ||||
|     /// <summary>Time source used by the scheduler</summary> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue