Fix reference to null object

to avoid rng.isOnEditable on a null object
Merge pull request #173 from glad2learn/patch-1

Fix reference to null object