Преглед на файлове

Guard against the complete absence of styles.

Geoffrey J. Teale преди 12 години
родител
ревизия
80ea6d90cd
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      cell.go

+ 2 - 0
cell.go

@@ -118,6 +118,8 @@ func (c *Cell) GetStyle() Style {
 
 
 // The number format string is returnable from a cell.
 // The number format string is returnable from a cell.
 func (c *Cell) GetNumberFormat() string {
 func (c *Cell) GetNumberFormat() string {
+	if c.styles == nil { return "" }
+	if c.styles.CellXfs == nil { return "" }
 	var numberFormat string = ""
 	var numberFormat string = ""
 	if c.styleIndex > -1 && c.styleIndex <= len(c.styles.CellXfs) {
 	if c.styleIndex > -1 && c.styleIndex <= len(c.styles.CellXfs) {
 		xf := c.styles.CellXfs[c.styleIndex]
 		xf := c.styles.CellXfs[c.styleIndex]