defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

Error when saving after copy-paste of components #248

Closed Malmer closed 7 years ago

Malmer commented 7 years ago

Expected behaviour

Files are saved, no complaining.

Actual behaviour

Java error. Files are not saved.

Steps to reproduce

What I did: Select three components from a game object in a collection (in this case: two collection factories and one script) Press Cmd+C to copy to clipboard Create new game object file Paste using Cmd+V Press Cmd+S to save

Stacktrace

{:cause "Message missing required fields: type, data",
 :via
 [{:type java.security.PrivilegedActionException,
   :message nil,
   :at
   [java.security.AccessController doPrivileged "AccessController.java" -2]}
  {:type java.lang.reflect.InvocationTargetException,
   :message nil,
   :at
   [sun.reflect.NativeMethodAccessorImpl invoke0 "NativeMethodAccessorImpl.java" -2]}
  {:type com.google.protobuf.UninitializedMessageException,
   :message "Message missing required fields: type, data",
   :at
   [com.google.protobuf.AbstractMessage$Builder newUninitializedMessageException "AbstractMessage.java" 550]}],
 :trace
 [[com.google.protobuf.AbstractMessage$Builder newUninitializedMessageException "AbstractMessage.java" 550]
  [com.dynamo.gameobject.proto.GameObject$EmbeddedComponentDesc$Builder build "GameObject.java" 1329]
  [com.dynamo.gameobject.proto.GameObject$EmbeddedComponentDesc$Builder build "GameObject.java" 1285]
  [editor.protobuf$map__GT_pb invokeStatic "protobuf.clj" 295]
  [editor.protobuf$map__GT_pb invoke "protobuf.clj" 284]
  [editor.protobuf$clj__GT_java invokeStatic "protobuf.clj" 255]
  [editor.protobuf$set_field$fn__8913 invoke "protobuf.clj" 277]
  [clojure.core$map$fn__4785 invoke "core.clj" 2644]
  [clojure.lang.LazySeq sval "LazySeq.java" 40]
  [clojure.lang.LazySeq seq "LazySeq.java" 49]
  [clojure.lang.RT seq "RT.java" 521]
  [clojure.lang.SeqIterator hasNext "SeqIterator.java" 38]
  [com.google.protobuf.AbstractMessageLite$Builder addAll "AbstractMessageLite.java" 310]
  [com.dynamo.gameobject.proto.GameObject$PrototypeDesc$Builder addAllEmbeddedComponents "GameObject.java" 1991]
  [sun.reflect.NativeMethodAccessorImpl invoke0 "NativeMethodAccessorImpl.java" -2]
  [sun.reflect.NativeMethodAccessorImpl invoke "NativeMethodAccessorImpl.java" 62]
  [sun.reflect.DelegatingMethodAccessorImpl invoke "DelegatingMethodAccessorImpl.java" 43]
  [java.lang.reflect.Method invoke "Method.java" 498]
  [editor.protobuf$set_field invokeStatic "protobuf.clj" 282]
  [editor.protobuf$map__GT_pb$fn__8918 invoke "protobuf.clj" 294]
  [clojure.core$map$fn__4785 invoke "core.clj" 2644]
  [clojure.lang.LazySeq sval "LazySeq.java" 40]
  [clojure.lang.LazySeq seq "LazySeq.java" 49]
  [clojure.lang.Cons next "Cons.java" 39]
  [clojure.lang.RT next "RT.java" 688]
  [clojure.core$next__4341 invokeStatic "core.clj" 64]
  [clojure.core$dorun invokeStatic "core.clj" 3033]
  [clojure.core$doall invokeStatic "core.clj" 3039]
  [editor.protobuf$map__GT_pb invokeStatic "protobuf.clj" 293]
  [editor.protobuf$map__GT_str invokeStatic "protobuf.clj" 297]
  [editor.protobuf$map__GT_str invoke "protobuf.clj" 297]
  [editor.protobuf$map__GT_str invokeStatic "protobuf.clj" 298]
  [editor.game_object$fn__27575 invokeStatic "game_object.clj" 232]
  [editor.game_object$fn__27575 invoke "game_object.clj" 232]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.AFn applyTo "AFn.java" 144]
  [clojure.lang.AFunction$1 doInvoke "AFunction.java" 29]
  [clojure.lang.RestFn invoke "RestFn.java" 408]
  [clojure.lang.Var invoke "Var.java" 379]
  [editor.game_object$GameObjectNode$behavior$save_data invokeStatic "game_object.clj" 304]
  [editor.game_object$GameObjectNode$behavior$save_data invoke "game_object.clj" 304]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$pull_input_values$fn__4474 invoke "node.clj" 1112]
  [clojure.core$mapv$fn__6953 invoke "core.clj" 6627]
  [clojure.lang.PersistentVector reduce "PersistentVector.java" 341]
  [clojure.core$reduce invokeStatic "core.clj" 6544]
  [clojure.core$mapv invokeStatic "core.clj" 6618]
  [internal.node$pull_input_values invokeStatic "node.clj" 1113]
  [editor.defold_project$Project$behavior$save_data invokeStatic "defold_project.clj" 506]
  [editor.defold_project$Project$behavior$save_data invoke "defold_project.clj" 506]
  [clojure.lang.Var invoke "Var.java" 383]
  [internal.node.NodeImpl produce_value "node.clj" 271]
  [internal.node$node_value_STAR_ invokeStatic "node.clj" 338]
  [internal.node$node_value invokeStatic "node.clj" 353]
  [dynamo.graph$node_value invokeStatic "graph.clj" 738]
  [editor.defold_project$write_save_data_to_disk_BANG_ invokeStatic "defold_project.clj" 164]
  [editor.defold_project$save_all_BANG_$fn__12061$fn__12062 invoke "defold_project.clj" 261]
  [editor.defold_project$save_all_BANG_$fn__12061 invoke "defold_project.clj" 261]
  [clojure.core$binding_conveyor_fn$fn__4676 invoke "core.clj" 1938]
  [clojure.lang.AFn call "AFn.java" 18]
  [java.util.concurrent.FutureTask run "FutureTask.java" 266]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1142]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 617]
  [java.lang.Thread run "Thread.java" 745]]}

Defold version: 1.2.94 Defold sha: 04b0207f0e96f05203ed30a5bfc61917b1e1cde1 Platform: Mac OS X 10.12.1 (x86_64) Java version: 1.8.0_102-b14

Malmer commented 7 years ago

Overall the copy-paste of components and game objects seem to be quite crash-prone.

RagnarSvenssonKing commented 7 years ago

Filed as DEFEDIT-672

matgis-king commented 7 years ago

A fix has been merged into dev, and a new build will be produced during the day. Pasting of referenced components was generally broken. Hopefully copy-paste should work better now. Thanks for reporting!