Added validation for zero Id on parsing parameters
parent
15f58054d0
commit
af3d324fae
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using NLog;
|
||||
|
@ -91,6 +92,9 @@ namespace WatchFace.Models
|
|||
var id = (byte) ((rawId & 0xf8) >> 3);
|
||||
var flags = (ParameterFlags) (rawId & 0x7);
|
||||
|
||||
if (id == 0)
|
||||
throw new ArgumentException("Parameter with zero Id is invalid.");
|
||||
|
||||
var value = ReadValue(fileStream);
|
||||
if (flags.HasFlag(ParameterFlags.HasChildren))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue