Fixed random NULL

Makes sure the error is not null