File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -715,8 +715,11 @@ DatabaseCollection.prototype.insert = function insert(document) {
715715 var component = null ;
716716 var channels = [ ] ;
717717 var channel = null ;
718-
718+
719719 switch ( true ) {
720+ case obj === null :
721+ $log . invalidDocumentOnDbInsert ( obj , this . name ) ;
722+ break ;
720723 case this . name === '_Schema' :
721724 case this . name === '_Logger' :
722725 case this . name === '_Model' :
Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ describe('System Runtime db component', () => {
157157
158158 expect ( docAdded [ 0 ] ) . equal ( 'runtime1' ) ;
159159
160+ // try to insert an invalid document
161+ let invalidDoc = db . _Runtime . insert ( null ) ;
162+
163+ expect ( invalidDoc . length ) . equal ( 0 ) ;
164+
160165 // try to insert the same document
161166 docAdded = db . _Runtime . insert ( {
162167 '_id' : 'runtime1' ,
You can’t perform that action at this time.
0 commit comments