Skip to content

Commit

Permalink
Fix crash on asm gen when no settings file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
fadden committed Apr 19, 2019
1 parent 6998eb4 commit 6185b85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ as well as many less-common ones.
processor status flags are tracked, allowing identification of branches
that are always/never taken, accurate cycle count listings, and correct
analysis of 65816 code with variable-width registers.
- Easy generation of assembly source code in popular formats (currently
cc65 and Merlin 32). Cross-assemblers can be invoked from the GUI to
verify correctness.
- Easy generation of assembly source code for popular cross-assemblers
(currently cc65, 64tass, and Merlin 32). Cross-assemblers can be invoked
from the GUI to verify correctness.
- Symbols and constants are provided for ROM and operating system entry
points on several popular systems.
- Project files are designed for sharing and collaboration.</li>
Expand Down
7 changes: 5 additions & 2 deletions SourceGen/AsmGen/AssemblerConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ private static string GetSettingName(AssemblerInfo.Id id) {

/// <summary>
/// Creates a populated AssemblerConfig from the app settings for the specified ID.
/// If the assembler hasn't been configured yet, the default configuration object
/// will be returned.
/// </summary>
/// <param name="settings">Settings object to pull the values from.</param>
/// <param name="id">Assembler ID.</param>
/// <returns>The AssemblerConfig, or null if not configured.</returns>
/// <returns>The AssemblerConfig.</returns>
public static AssemblerConfig GetConfig(AppSettings settings, AssemblerInfo.Id id) {
string cereal = settings.GetString(GetSettingName(id), null);
if (string.IsNullOrEmpty(cereal)) {
return null;
IAssembler asm = AssemblerInfo.GetAssembler(id);
return asm.GetDefaultConfig();
}

JavaScriptSerializer ser = new JavaScriptSerializer();
Expand Down

0 comments on commit 6185b85

Please sign in to comment.