Fix error when adding ref with no snaks-order

If no snaks-order is passed the module dies
This no longer dies!

Change-Id: Ia9fe1bcd83ab97f8c6854e3cc567fd7241e3b986
(cherry picked from commit 3e46e58729e98f61b914680f3c035ef6caf2d06a)