Added test. In some cases $result is null.

Look at https://github.com/owncloud/core/issues/7373