diff options
author | Jon Skeet <skeet@pobox.com> | 2008-10-02 21:46:17 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2008-10-02 21:46:17 +0100 |
commit | 7f90d8ee57d4af4215bc31dbb07726c023c5e047 (patch) | |
tree | 9a892e6f6f68e4a75c5e766d95e4cd42857b1bc6 /csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs | |
parent | 7fd62ffd77ccedfc6dbe2384901b375859b726b6 (diff) | |
download | protobuf-7f90d8ee57d4af4215bc31dbb07726c023c5e047.tar.gz protobuf-7f90d8ee57d4af4215bc31dbb07726c023c5e047.tar.bz2 protobuf-7f90d8ee57d4af4215bc31dbb07726c023c5e047.zip |
Made things a bit more public for the sake of ProtoGen
Diffstat (limited to 'csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs')
-rw-r--r-- | csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs b/csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs index 429282b7..3fa3360e 100644 --- a/csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs +++ b/csharp/ProtocolBuffers/Descriptors/FileDescriptor.cs @@ -175,7 +175,8 @@ namespace Google.ProtocolBuffers.Descriptors { /// </summary> /// <param name="proto">The protocol message form of the FileDescriptor.</param> /// <param name="dependencies">FileDescriptors corresponding to all of the - /// file's dependencies, in the exact order listed in the .proto file</param> + /// file's dependencies, in the exact order listed in the .proto file. May be null, + /// in which case it is treated as an empty array.</param> /// <exception cref="DescriptorValidationException">If <paramref name="proto"/> is not /// a valid descriptor. This can occur for a number of reasons, such as a field /// having an undefined type or because two messages were defined with the same name.</exception> @@ -189,6 +190,10 @@ namespace Google.ProtocolBuffers.Descriptors { // FieldDescriptor for an embedded message contains a pointer directly // to the Descriptor for that message's type. We also detect undefined // types in the linking step. + if (dependencies == null) { + dependencies = new FileDescriptor[0]; + } + DescriptorPool pool = new DescriptorPool(dependencies); FileDescriptor result = new FileDescriptor(proto, dependencies, pool); |