 				} else {
 					fieldDescriptor = Object(message).constructor[
 							name.toUpperCase()]
+					if (!fieldDescriptor) {
+						throw new IOError("Unknown field: " + name);
+					}
 				}
 			}
 			const repeatedFieldDescriptor:RepeatedFieldDescriptor =

						if (enumRepeatedFieldDescriptor) {
							printEnum(output, int(value),
									enumRepeatedFieldDescriptor.enumType)
						} else {
							output.writeUTFBytes(value.toString())
						}

﻿// vim: tabstop=4 shiftwidth=4

// Copyright (c) 2011 , Yang Bo All rights reserved.
//
