Skip to content

Commit

Permalink
Fix for null page or global options
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprodan committed Oct 24, 2013
1 parent a90a292 commit 1b369d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions RequireJsNet/RequireJsOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,15 @@ internal static string ConvertToJsObject(Dictionary<string, object> options)
var config = new StringBuilder();

config.Append("{");
foreach (var item in options)

if (options != null)
{
config.AppendFormat(" {0}: {1}{2} ", item.Key, JsonConvert.SerializeObject(item.Value), options.Last().Equals(item) ? "" : ",");
foreach (var item in options)
{
config.AppendFormat(" {0}: {1}{2} ", item.Key, JsonConvert.SerializeObject(item.Value), options.Last().Equals(item) ? "" : ",");
}
}

config.Append("}");
return config.ToString();
}
Expand Down

0 comments on commit 1b369d2

Please sign in to comment.