Null check for old

This commit is contained in:
thosakwe 2017-06-06 08:31:00 -04:00
parent cc759d5268
commit 786cfb9d24
3 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
# hot
[![version 1.0.0-rc.1](https://img.shields.io/badge/pub-1.0.0--rc.1-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink)
[![version 1.0.0-rc.2](https://img.shields.io/badge/pub-1.0.0--rc.2-brightgreen.svg)](https://pub.dartlang.org/packages/angel_rethink)
Supports *hot reloading* of Angel servers on file changes. This is faster and
more reliable than merely reactively restarting a `Process`.

View file

@ -177,8 +177,8 @@ class HotReloader {
_handleWatchEvent(WatchEvent e) async {
print('${e.path} changed. Reloading server...');
var old = _server;
if (old != null) Future.forEach(old.justBeforeStop, old.configure);
_server = null;
Future.forEach(old.justBeforeStop, old.configure);
_client ??=
new VMServiceClient.connect(vmServiceUrl ?? 'ws://localhost:8181/ws');

View file

@ -1,6 +1,6 @@
name: angel_hot
description: Supports hot reloading of Angel servers on file changes.
version: 1.0.0-rc.1
version: 1.0.0-rc.2
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/hot
environment: