fix too generous check - null is not undefined