Permalink
Browse files

Fixed NPE

  • Loading branch information...
RobertBColton committed Jun 6, 2013
1 parent 9add999 commit 3f667d4ca20ed5c92aeb9862a00f9d3d2e99231b
Showing with 8 additions and 1 deletion.
  1. +8 −1 org/lateralgm/file/GmFileReader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006-2011 IsmAvatar <IsmAvatar@gmail.com>
+a * Copyright (C) 2006-2011 IsmAvatar <IsmAvatar@gmail.com>
* Copyright (C) 2006, 2007, 2008 Clam <clamisgood@gmail.com>
* Copyright (C) 2007, 2008, 2009 Quadduc <quadduc@gmail.com>
* Copyright (C) 2013, Robert B. Colton
@@ -1182,6 +1182,12 @@ private static void readActions(GmFileContext c, ActionContainer container, Stri
la.id = actid;
la.parentId = libid;
la.actionKind = (byte) in.read4();
+ if (la.actionKind == Action.ACT_CODE) {
+ la = LibManager.codeAction;
+ in.skip(16);
+ in.skip(in.read4());
+ in.skip(in.read4());
+ } else {
la.allowRelative = in.readBool();
la.question = in.readBool();
la.canApplyTo = in.readBool();
@@ -1195,6 +1201,7 @@ private static void readActions(GmFileContext c, ActionContainer container, Stri
else
in.skip(in.read4());
}
+ }
else
{
in.skip(20);

1 comment on commit 3f667d4

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Apr 12, 2016

Collaborator

What this change did was make it possible to disable loading the action libraries but still be able to use the code action. This was for the feature originally added to master that allowed you to disable drag and drop. It was later discovered that this was not possible and had to be reverted because of an issue with the EGM format. However, it would still be ok to make this change in the rare event that all action libraries fail to load or are missing, then at least the code action works.

Collaborator

RobertBColton commented on 3f667d4 Apr 12, 2016

What this change did was make it possible to disable loading the action libraries but still be able to use the code action. This was for the feature originally added to master that allowed you to disable drag and drop. It was later discovered that this was not possible and had to be reverted because of an issue with the EGM format. However, it would still be ok to make this change in the rare event that all action libraries fail to load or are missing, then at least the code action works.

Please sign in to comment.